// POST: api/Brand // Adds new brand // body = Brand object // SOAP Name = AddBrand public IHttpActionResult Post([FromBody] Brand brand) { var content = new Response <Brand>(); try { using (var brandBusiness = new BrandBusiness()) { content = brandBusiness.AddBrand(brand); } } catch (Exception ex) { content.isSuccess = false; content.Message += ex.Message; } return(new StandartResult <Brand>(content, Request)); }
public Response <Brand> AddBrand(Brand entity) { Response <Brand> res = new Response <Brand>(); try { using (var brandBusiness = new BrandBusiness()) { res = brandBusiness.AddBrand(entity); } } catch (Exception ex) { res.isSuccess = false; res.Message = "An error occured in AddBrand() func. in Spice-WebService.BrandService\n" + ex.Message; } return(res); }