using DW5S.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DW5S.Repostory { public interface IUnitOfWork : IAsyncDisposable { IRepository Of() where TEntity : BaseEntity; Task SaveAsync(); } public class UnitOfWork : IUnitOfWork { private readonly OracleContext ctx; public IRepository Of() where TEntity : BaseEntity { throw new NotImplementedException(); } public UnitOfWork(OracleContext ctx) { this.ctx = ctx; } public async Task SaveAsync() { return await ctx.SaveChangesAsync(); } public async ValueTask DisposeAsync() { await ctx.DisposeAsync(); } } }