Пример #1
0
        public void Enrich(IHalResponseBuilder halResponseBuilder, ShopCategoryAggregate category)
        {
            if (halResponseBuilder == null)
            {
                throw new ArgumentNullException(nameof(halResponseBuilder));
            }

            if (category == null)
            {
                throw new ArgumentNullException(nameof(category));
            }

            halResponseBuilder.AddEmbedded(e => e.AddObject(_responseBuilder.GetShopCategory(category), (l) => l.AddSelf(@"/" + Constants.RouteNames.ShopCategories + "/" + category.Id)));
        }
Пример #2
0
        public static Category ToModel(this ShopCategoryAggregate category)
        {
            if (category == null)
            {
                throw new ArgumentNullException(nameof(category));
            }

            return(new Category
            {
                Id = category.Id,
                Description = category.Description,
                Name = category.Name,
                ParentId = category.ParentId,
                PinImagePartialPath = category.PinImagePartialPath
            });
        }
Пример #3
0
 public AddShopValidationResult(ShopCategoryAggregate category)
 {
     IsValid  = true;
     Category = category;
 }