Example #1
0
        public async Task <IActionResult> Post([FromBody] string descricao)
        {
            var tipoBoleto = new TipoBoleto {
                Descricao = descricao
            };
            await _context.TipoBoleto.AddAsync(tipoBoleto);

            await _context.SaveChangesAsync();

            return(CreatedAtAction("Get", new { id = tipoBoleto.Id }));
        }
Example #2
0
        public async Task <IActionResult> Put(int id, [FromBody] string descricao)
        {
            var tipoBoleto = await _context.TipoBoleto.FindAsync(id);

            if (tipoBoleto == null)
            {
                return(NotFound());
            }


            tipoBoleto = new TipoBoleto {
                Id = id, Descricao = descricao
            };
            _context.Entry(tipoBoleto).State = EntityState.Modified;
            await _context.SaveChangesAsync();


            return(Ok());
        }
        public IEnumerable <TipoBoleto> Fatch(TipoBoleto entity)
        {
            var sqlParameterList = DataHelper.GetSqlParameterList(entity);

            return(DataHelper.List <TipoBoleto>("PR_TIPO_BOLETO_CONSULTAR", sqlParameterList));
        }
 public IEnumerable <TipoBoleto> Listar(TipoBoleto entity)
 {
     return(_repository.Fatch(entity));
 }