- 增加 IUpdate.WhereCaseSource 方法,实现批量修改时的条件判断;

- 增加 FreeSql.DbContext 行级锁;
This commit is contained in:
28810
2019-03-29 12:58:58 +08:00
parent 025259bb81
commit 4edfb04010
18 changed files with 220 additions and 39 deletions

View File

@@ -0,0 +1,26 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;
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;
}
}
}