public async Task <IHttpActionResult> Update([FromBody] QuadroModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } object result = await repository.Update(rhNetContext, model); if (result.GetType() == typeof(QuadroModel)) { return(Ok(result)); } else { return(BadRequest(result.ToString())); } }
public async Task <ActionResult> Update([FromServices] RhNetContext rhNetContext, [FromBody] QuadroModel quadroModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } QuadroRepository repository = new QuadroRepository(); object result = await repository.Update(rhNetContext, quadroModel); if (result.GetType() == typeof(QuadroModel)) { return(Ok(result)); } else { return(BadRequest(result.ToString())); } }