public IActionResult Create(ProductPricingCreateModel model) { var result = _pricingServices.Create(model); if (result.IsSuccessStatusCode) { return(Ok(result)); } return(BadRequest()); }
public BaseResponse <bool> Create(ProductPricingCreateModel model) { try { var entity = new YachtMerchantProductPricings(); entity.InjectFrom(model); entity.Deleted = false; entity.CreatedBy = GetUserGuidId(); entity.CreatedDate = DateTime.Now; entity.LastModifiedDate = DateTime.Now; entity.LastModifiedBy = GetUserGuidId(); _context.YachtMerchantProductPricings.Add(entity); _context.SaveChangesAsync().Wait(); return(BaseResponse <bool> .Success(true)); } catch (Exception ex) { return(BaseResponse <bool> .InternalServerError(message : ex.Message, fullMsg : ex.StackTrace)); } }