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); }
public static void MapToExisting(this ProductCategoryAddOrUpdateModel cat, ProductCategory existingCategory) { Mapper.Map(cat, existingCategory); }
public static ProductCategory MapToModel(this ProductCategoryAddOrUpdateModel cat) { return(Mapper.Map <ProductCategory>(cat)); }