예제 #1
0
        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()));
            }
        }
예제 #2
0
        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()));
            }
        }