protected async Task CommitRemoveAsync(Domain.DomainModels.Category category) { using (var unitOfWork = UnitOfWorkFactory.Create()) { await CategoryRepository.RemoveAsync(category); await unitOfWork.CommitAsync(); } }
public static Domain.DomainModels.Transaction CreateTransaction( Guid id, DateTime?date = null, decimal?amount = null, Domain.DomainModels.Category category = null) { return(new Domain.DomainModels.Transaction( id, date ?? DateTime.Now, amount ?? 10, category ?? CategoryData.CreateCategory(Guid.NewGuid()))); }
public static Models.Category Convert(Domain.DomainModels.Category category) { if (category == null) { throw new ArgumentNullException(nameof(category)); } return(new Models.Category { Id = category.Id.ToString(), Name = category.Name, Description = category.Description, Type = (int)category.Type }); }