Ejemplo n.º 1
0
        //[ValidateAntiForgeryToken]
        public JsonResult Edit(
            //[Bind(Include = "FieldId,Name,Events,Active,ClientId")]
            FieldViewModel fieldViewModel)
        {
            if (ModelState.IsValid)
            {
                var result = fieldAppService.Update(fieldViewModel);

                if (!result.IsValid)
                {
                    foreach (var validationAppError in result.Errors)
                    {
                        ModelState.AddModelError(string.Empty, validationAppError.Message);
                    }
                }
            }
            return(Json(fieldViewModel));
        }
Ejemplo n.º 2
0
 public void Put([FromBody] FieldViewModel fieldViewModel)
 {
     _fieldAppService.Update(fieldViewModel);
 }