public ActionResult Put([FromRoute] Guid id, [FromBody] Sample sample)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            sample.Id = id;
            _sampleApplicationService.Update(sample);
            return(Ok(sample));
        }
Пример #2
0
 public ActionResult Edit(Sample sample)
 {
     try
     {
         _sampleApplicationService.Update(sample);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }