flower-story/Server/Data/FlowerDatabase.cs
2023-05-23 22:08:56 +08:00

40 lines
900 B
C#

using Blahblah.FlowerStory.Server.Data.Model;
using Microsoft.EntityFrameworkCore;
namespace Blahblah.FlowerStory.Server.Data;
/// <summary>
/// 数据库管理类
/// </summary>
public class FlowerDatabase : DbContext
{
/// <summary>
/// 构造数据库对象
/// </summary>
/// <param name="options">选项参数</param>
public FlowerDatabase(DbContextOptions<FlowerDatabase> options) : base(options)
{
//Database.Migrate();
}
/// <summary>
/// 用户集
/// </summary>
public DbSet<UserItem> Users { get; set; }
/// <summary>
/// 花草集
/// </summary>
public DbSet<FlowerItem> Flowers { get; set; }
/// <summary>
/// 记录集
/// </summary>
public DbSet<RecordItem> Records { get; set; }
/// <summary>
/// 会话令牌集
/// </summary>
public DbSet<TokenItem> Tokens { get; set; }
}