bitget asp 서버 추가
This commit is contained in:
33
Bitget_Server/EFCore/BitgetContext.cs
Normal file
33
Bitget_Server/EFCore/BitgetContext.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Bitget_Server/EFCore/Models/PushAlarm.cs
Normal file
24
Bitget_Server/EFCore/Models/PushAlarm.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user