baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Opsoft.NetCore.O3App.Domain;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.Infrastructure.Repositories
|
||||
{
|
||||
[MapTo(typeof(IDapperUnitOfWorkFactory), ServiceLifetime.Transient)]
|
||||
internal class DapperUnitOfWorkFactory : IDapperUnitOfWorkFactory
|
||||
{
|
||||
private readonly IDapperContextFactory dapperContextFactory;
|
||||
|
||||
public DapperUnitOfWorkFactory(IDapperContextFactory dapperContextFactory)
|
||||
{
|
||||
this.dapperContextFactory = Guard.ArgumentNotNull(dapperContextFactory, nameof(dapperContextFactory));
|
||||
}
|
||||
|
||||
public IDapperUnitOfWork Create(string dbName = Constants.DatabaseNames.Default, bool @readonly = false)
|
||||
{
|
||||
return new DapperUnitOfWork(dapperContextFactory.Create(dbName, @readonly));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user