public async Task <Models.Test.Example> InsertThenGetAsync(ISqlServerDbSession dbSession, Models.Test.Example example) { await UnitOfWork.Use <IExampleRepo>(dbSession).InsertExampleAsync(example); // Equal to: session.SaveChanges(); UnitOfWork.SaveChanges(dbSession); var result = await UnitOfWork.Use <IExampleRepo>(dbSession).GetExampleAsync(example.Id); return(result); }
public SqlServerUnitOfWork(IServiceProvider serviceProvider, ISqlServerDbSession sqlServerDbSession) : base(serviceProvider, sqlServerDbSession) { }
public TRepo Use <TRepo>(ISqlServerDbSession dbSession) where TRepo : IEFCoreRepo => base.Create <TRepo>(dbSession);