Canon/Canon.Server/Services/CompileDbContext.cs
Ichirinko 366991046a feat: 编译历史记录和代码生成结果(#51)
地址已绑定编译结果,支持历史记录切换功能

Co-authored-by: jackfiled <xcrenchangjun@outlook.com>
Reviewed-on: PostGuard/Canon#51
Co-authored-by: Ichirinko <1621543655@qq.com>
Co-committed-by: Ichirinko <1621543655@qq.com>
2024-04-22 21:26:34 +08:00

22 lines
566 B
C#

using Canon.Server.Entities;
using Microsoft.EntityFrameworkCore;
using MongoDB.EntityFrameworkCore.Extensions;
namespace Canon.Server.Services;
public class CompileDbContext : DbContext
{
public DbSet<CompileResult> CompileResults { get; init; }
public CompileDbContext(DbContextOptions<CompileDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<CompileResult>().ToCollection("compilerResults");
}
}