public async Task <IHttpActionResult> Post([FromBody] FranchiseeViewModel franchisee) { var result = await _franchiseeService.AddOrUpdateFranchisee(franchisee.ToMap <Entities.Entities.Franchisee>()); if (result != null) { return(Created(Request.RequestUri + result.Id.ToString(), result)); } return(Conflict()); }
public async Task <IHttpActionResult> Put(int id, [FromBody] FranchiseeViewModel franchisee) { var currentCar = await _franchiseeService.GetFranchiseeById(id); if (currentCar == null) { return(NotFound()); } var result = await _franchiseeService.AddOrUpdateFranchisee(franchisee.ToMap <Entities.Entities.Franchisee>()); if (result != null) { return(Ok(result)); } return(Content(HttpStatusCode.NoContent, franchisee)); }