public virtual async Task <TAggregateRoot> AddAndReturnAsync(TAggregateRoot aggregateRoot, bool autoExecute = true, CancellationToken cancellationToken = default) { var addedEntity = (await DbContext.AddAsync(POManager.MapToPO(aggregateRoot), cancellationToken)).Entity; if (autoExecute) { await DbContext.SaveChangesAsync(cancellationToken); } return(POManager.MapToDO(addedEntity)); }
public virtual TAggregateRoot AddAndReturn(TAggregateRoot aggregateRoot, bool autoExecute = true) { var addedEntity = DbContext.Add(POManager.MapToPO(aggregateRoot)).Entity; if (autoExecute) { DbContext.SaveChanges(); } return(POManager.MapToDO(addedEntity)); }
public virtual Task UpdateAsync(TAggregateRoot aggregateRoot, CancellationToken cancellationToken = default) { DbSet.Update(POManager.MapToPO(aggregateRoot)); return(Task.CompletedTask); }
public virtual void Update(TAggregateRoot aggregateRoot) { DbSet.Update(POManager.MapToPO(aggregateRoot)); }
public virtual void Delete(TAggregateRoot aggregateRoot) { DbSet.Remove(POManager.MapToPO(aggregateRoot)); }
public virtual async Task AddAsync(TAggregateRoot aggregateRoot, CancellationToken cancellationToken = default) { await DbContext.AddAsync(POManager.MapToPO(aggregateRoot), cancellationToken); }
public virtual void Add(TAggregateRoot aggregateRoot) { DbContext.Add(POManager.MapToPO(aggregateRoot)); }