mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 优化 FreeSql.DbContext 构造方法,方便注入使用;
This commit is contained in:
		@@ -8,13 +8,16 @@ namespace dbcontext_01
 | 
			
		||||
 | 
			
		||||
    public class SongContext : DbContext
 | 
			
		||||
    {
 | 
			
		||||
        public SongContext() : base() { }
 | 
			
		||||
        public SongContext(IFreeSql fsql) : base(fsql, null) { }
 | 
			
		||||
 | 
			
		||||
        public DbSet<Song> Songs { get; set; }
 | 
			
		||||
        public DbSet<Tag> Tags { get; set; }
 | 
			
		||||
 | 
			
		||||
        //protected override void OnConfiguring(DbContextOptionsBuilder builder) {
 | 
			
		||||
        //	builder.UseFreeSql(dbcontext_01.Startup.Fsql);
 | 
			
		||||
        //}
 | 
			
		||||
        protected override void OnConfiguring(DbContextOptionsBuilder builder)
 | 
			
		||||
        {
 | 
			
		||||
            builder.UseFreeSql(Startup.Fsql);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user