Ejemplo n.º 1
0
 public IActionResult Put(long id, [FromBody] InstitutionViewModel institution)
 {
     if (_institutionAppService.GetById(institution.Id).Id != 0)
     {
         institution = _institutionAppService.Update(institution);
         institution.AddRangeLink(_institutionEnricher.CreateLinks(Method.Put, institution));
         return(Ok(institution));
     }
     else
     {
         return(BadRequest());
     }
 }
Ejemplo n.º 2
0
 public InstitutionViewModel Post([FromBody] InstitutionViewModel institution)
 {
     institution = _institutionAppService.Add(institution);
     institution.AddRangeLink(_institutionEnricher.CreateLinks(Method.Post, institution));
     return(institution);
 }