Beispiel #1
0
        protected async Task CommitRemoveAsync(Domain.DomainModels.Category category)
        {
            using (var unitOfWork = UnitOfWorkFactory.Create())
            {
                await CategoryRepository.RemoveAsync(category);

                await unitOfWork.CommitAsync();
            }
        }
Beispiel #2
0
 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())));
 }
Beispiel #3
0
        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
            });
        }