Exemplo n.º 1
0
        public void Update(Screen entity, long userId)
        {
            var screen = _screenRepository.GetId(entity.Id);

            screen.Nome  = entity.Nome;
            screen.Ativo = entity.Ativo;

            _screenRepository.Update(screen, userId, true);
        }
        public async Task <IActionResult> Put(string id, [FromBody] Screen screen)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(screen.Name))
                {
                    throw new System.Exception("Required fields not supplied.");
                }

                screen.Id = new ObjectId(id);
                return await _screenRepository.Update(screen);
            }));
        }