Exemplo n.º 1
0
        public void Post(CategoriaDto dto)
        {
            if (dto == null)
            {
                throw new Exception("Parâmetros inválidos");
            }

            Categoria db = new Categoria
            {
                Ativo        = dto.Ativo,
                DataCadastro = DateTime.Now,
                Nome         = dto.Nome
            };

            _repository.Add(db);
            _repository.Commit();
        }