public bool POST([FromBody] User user) { try { bool respuesta = false; using (DrogadiccionEntities context = new DrogadiccionEntities()) { //context.Configuration.ProxyCreationEnabled = false; var data = context.Usuarios.Where(x => x.Usuario == user.Name).Select(s => new { s.ContrseƱa, s.Usuario }).ToList(); if (data.Count > 0) { foreach (var item in data) { if (user.password == item.ContrseƱa) { respuesta = true; } } } return(respuesta); } } catch (Exception ex) { throw; } }
public ActionResult Sigin(Usuario User) { try { using (DrogadiccionEntities context = new DrogadiccionEntities()) { var user = context.Usuario.Where(x => x.email == User.email); return(Redirect("Home/Index")); } } catch (Exception ex) { throw; } }