예제 #1
0
        public async Task <IHttpActionResult> Post(ProductCategoryAddOrUpdateModel model)
        {
            IHttpActionResult res = BadRequest();
            var serviceRes        = await _productCatService.Add(new ProductCategoryAddRequest()
            {
                RequestOwner = User,
                Model        = model,
            });

            if (serviceRes.Access == ResponseAccess.Granted)
            {
                res = Ok();
            }
            if (serviceRes.Access == ResponseAccess.Deny)
            {
                res = Unauthorized();
            }
            return(res);
        }
예제 #2
0
 public static void MapToExisting(this ProductCategoryAddOrUpdateModel cat, ProductCategory existingCategory)
 {
     Mapper.Map(cat, existingCategory);
 }
예제 #3
0
 public static ProductCategory MapToModel(this ProductCategoryAddOrUpdateModel cat)
 {
     return(Mapper.Map <ProductCategory>(cat));
 }