Пример #1
0
 public Assunto(int tipoAssuntoId, string descricao, string providencia)
 {
     Id            = Guid.NewGuid();
     TipoAssuntoId = tipoAssuntoId;
     TipoAssunto   = TipoAssunto = TiposAssunto.FirstOrDefault(t => t.Id == tipoAssuntoId);
     Providencia   = providencia;
 }
        public async Task <ActionResult <TiposAssunto> > PostTiposAssunto(TiposAssunto tiposAssunto)
        {
            _context.TiposAssunto.Add(tiposAssunto);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTiposAssunto", new { id = tiposAssunto.idTipoAssunto }, tiposAssunto));
        }
Пример #3
0
 public Assunto(int tipoAssuntoId, string descricao)
 {
     Id            = Guid.NewGuid();
     TipoAssuntoId = tipoAssuntoId;
     TipoAssunto   = TiposAssunto.FirstOrDefault(t => t.Id == tipoAssuntoId);
     Descricao     = descricao;
 }
        public async Task <IActionResult> PutTiposAssunto(int id, TiposAssunto tiposAssunto)
        {
            if (id != tiposAssunto.idTipoAssunto)
            {
                return(BadRequest());
            }

            _context.Entry(tiposAssunto).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TiposAssuntoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #5
0
 public Assunto(int tipoAssuntoId, string descricao, TimeSpan duracaoAtendimento)
 {
     Id                 = Guid.NewGuid();
     TipoAssuntoId      = tipoAssuntoId;
     TipoAssunto        = TipoAssunto = TiposAssunto.FirstOrDefault(t => t.Id == tipoAssuntoId);
     Descricao          = descricao;
     DuracaoAtendimento = duracaoAtendimento;
 }