using Quadarax.Foundation.Core.Data.Interface.Domain; using Quadarax.Foundation.Core.Object; namespace Quadarax.Foundation.Core.Data.Domain { public class UnitOfWork : DisposableObject, IUnitOfWork where TDomainContext : IDomain { public TDomainContext Context { get; protected set; } public UnitOfWork(IDomainContextResolver context) { Context = context.GetCurrent(); } public void Commit() { Context?.Commit(); } protected override void OnDisposing() { Context = default!; } } }