Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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 }));
            }
        }
Exemplo n.º 3
0
        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 }));
            }
        }