bitget asp 서버 추가

This commit is contained in:
DESKTOP-F6681KC\llk
2024-06-02 19:32:08 +09:00
parent 4db5a85e55
commit 1be2f7c5a7
15 changed files with 345 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
using Bitget_Server.Common;
using Bitget_Server.EFCore.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bitget_Server.EFCore
{
public class BitgetContext : DbContext
{
public DbSet<PushAlarm> PushAlarms { get; set; }
public BitgetContext(DbContextOptions<BitgetContext> options)
: base(options)
{
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(CommonProperty.EfCoreConnectionStr);
base.OnConfiguring(optionsBuilder);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bitget_Server.EFCore.Models
{
public class PushAlarm
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public DateTime AlarmTime { get; set; }
public string Title { get; set; } = string.Empty;
public string Contents { get; set; } = string.Empty;
}
}