FileSqlServerSync/Server/RemoteServer/Models/SqliteDbContext.cs
zhaoyouya 46315ba760 chore: 添加sqlite 数据库,remote server 增加一些接口
添加了一些数据模型,添加了一些简单的单元测试
2024-10-12 21:57:45 +08:00

23 lines
652 B
C#

using Microsoft.EntityFrameworkCore;
namespace RemoteServer.Models;
public class SqliteDbContext : DbContext
{
protected readonly IConfiguration Configuration;
public SqliteDbContext(IConfiguration configuration)
{
Configuration = configuration;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite(Configuration.GetConnectionString("DbPath"));
}
public DbSet<SyncLogHead> SyncLogHeads { get; set; }
public DbSet<SyncLogFile> SyncLogFiles { get; set; }
public DbSet<SyncGitCommit> SyncGitCommits { get; set; }
}