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

                await unitOfWork.CommitAsync();
            }
        }
コード例 #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())));
 }
コード例 #3
0
ファイル: CategoryConverter.cs プロジェクト: as94/home-bank
        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
            });
        }