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()); } }
public HomeViewModel Post([FromBody] HomeViewModel home) { home = _homeAppService.Add(home); home.AddRangeLink(_homeEnricher.CreateLinks(Method.Post, home)); return(home); }