public IActionResult Post([FromBody] EducationModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var entity = model.ToEntity(); entity.Id = 0; _educationService.Insert(entity); //locales UpdateLocales(entity, model); return(NoContent()); }
public ActionResult Put(int id, [FromBody] EducationModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var entity = _educationService.GetById(model.Id); entity = model.ToEntity(entity); _educationService.Update(entity); //locales UpdateLocales(entity, model); return(NoContent()); }