public List <Users> ListarUsuarios() { BaseUsuariosEntities db = new BaseUsuariosEntities(); List <Users> usuariosList = (from users in db.Users select users).ToList(); return(usuariosList); }
public Users ListarUnUsuario() { BaseUsuariosEntities db = new BaseUsuariosEntities(); Users usuario; usuario = (from users in db.Users select users).First(); return(usuario); }
public bool TestConnection() { using (var db = new BaseUsuariosEntities()) { DbConnection conn = db.Database.Connection; try { conn.Open(); // check the database connection return(true); } catch { return(false); } } }