Пример #1
0
 public Backend.Models.TbLogin Consultar(Backend.Models.TbLogin tb)
 {
     Backend.Models.TbLogin login = db.Consultar(tb);
     if (login == null)
     {
         throw new ArgumentException("Email ou senha incorretos");
     }
     return(login);
 }
Пример #2
0
 public ActionResult <Backend.Models.Response.LoginResponse> Consultar(Backend.Models.Request.LoginRequest req)
 {
     try
     {
         Backend.Models.TbLogin login = conv.ParaTabela(req);
         return(conv.ParaResponse(buss.Consultar(login)));
     }
     catch (Exception ex)
     {
         return(new BadRequestObjectResult(
                    new Backend.Models.Response.ErroResponse(ex.Message, 400)
                    ));
     }
 }