Exemplo n.º 1
0
 public override async Task <BaseReply> Incluir(TipoTarefaModel request, ServerCallContext context)
 {
     return(await Task.FromResult(new BaseReply
     {
         Id = _tipoTarefaAppService.Incluir(_mapper.Map <TipoTarefaViewModel>(request)).ToString()
     }));
 }
Exemplo n.º 2
0
        public ActionResult <ProjetoViewModel> Post([FromBody] ProjetoViewModel obj)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                obj.Id = _projetoAppService.Incluir(obj);
            }
            catch (Exception)
            {
                if (ObjExists(obj.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetProjeto", new { id = obj.Id }, obj));
        }
Exemplo n.º 3
0
 public override async Task <BaseReply> Incluir(ProjetoModel request, ServerCallContext context)
 {
     return(await Task.FromResult(new BaseReply
     {
         Id = _projetoAppService.Incluir(_mapper.Map <ProjetoViewModel>(request)).ToString()
     }));
 }
Exemplo n.º 4
0
        public ActionResult <SistemaViewModel> Post([FromBody] SistemaViewModel obj)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                _sistemaAppService.Incluir(obj);
            }
            catch (Exception)
            {
                if (ObjExists(obj.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction(nameof(Get), new { id = obj.Id }, obj));
        }