移除 FreeSql.DbContext,成为独立项目

This commit is contained in:
28810
2019-04-01 10:48:39 +08:00
parent 3ca91b70a9
commit be5259dd68
32 changed files with 35 additions and 1862 deletions

View File

@ -1,24 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using System;
namespace FreeSql {
public static class DbContextDependencyInjection {
public static IServiceCollection AddFreeDbContext<TDbContext>(this IServiceCollection services, Action<DbContextOptionsBuilder> options) where TDbContext : DbContext {
services.AddScoped<TDbContext>(sp => {
var ctx = Activator.CreateInstance<TDbContext>();
if (ctx._orm == null) {
var builder = new DbContextOptionsBuilder();
options(builder);
ctx._orm = builder._fsql;
}
return ctx;
});
return services;
}
}
}