mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-28 21:52:51 +08:00
23 lines
671 B
C#
23 lines
671 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
|
|
namespace efcore_to_freesql.DBContexts
|
|
{
|
|
|
|
public class BaseDBContext : DbContext
|
|
{
|
|
|
|
public static IFreeSql Fsql { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
Fsql.CodeFirst.ConfigEntity(modelBuilder.Model); //ͬ²½ÅäÖÃ
|
|
}
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
optionsBuilder.UseSqlite(@"Data Source=|DataDirectory|\document.db;Pooling=true;Max Pool Size=10");
|
|
}
|
|
}
|
|
} |