Esempio n. 1
0
 public IActionResult Put(long id, [FromBody] HomeViewModel home)
 {
     if (_homeAppService.GetById(home.Id).Id != 0)
     {
         home = _homeAppService.Update(home);
         home.AddRangeLink(_homeEnricher.CreateLinks(Method.Put, home));
         return(Ok(home));
     }
     else
     {
         return(BadRequest());
     }
 }
Esempio n. 2
0
 public HomeViewModel Post([FromBody] HomeViewModel home)
 {
     home = _homeAppService.Add(home);
     home.AddRangeLink(_homeEnricher.CreateLinks(Method.Post, home));
     return(home);
 }