public LiveDTO Update(LiveDTO live, Guid id) { //TODO: Verify live title exists _liveRepository.Update(_mapper.Map <LiveDomain>(live)); _uow.Commit(); var liveReturn = GetById(live.Id); return(_mapper.Map <LiveDTO>(liveReturn)); }
public IActionResult Post(LiveDTO live) { try { var userTemp = _liveService.Add(live); return(CreatedAtAction(nameof(GetById), new { id = userTemp.Id }, userTemp)); } catch (System.Exception ex) { return(BadRequest(new { message = ex.Message })); } }
public IActionResult Put(LiveDTO live, Guid id) { try { var liveItem = _liveService.GetById(id); _liveService.Update(live, id); return(Ok(live)); } catch (System.Exception ex) { return(BadRequest(new { message = ex.Message })); } }