public async Task <Guid> CreateAsync(Guid userId, ProductCategory category, CancellationToken ct) { var newCategory = new ProductCategory(); var change = newCategory.CreateWithLog(userId, x => { x.Id = category.Id; x.AccountId = category.AccountId; x.Name = category.Name; x.IsDeleted = category.IsDeleted; x.CreateDateTime = DateTime.UtcNow; }); var entry = await _storage.AddAsync(newCategory, ct); await _storage.AddAsync(change, ct); await _storage.SaveChangesAsync(ct); return(entry.Entity.Id); }