public IQueryable <Nanny> GetNannies() { var _db = new Nation1.Models.NannyContext(); IQueryable <Nanny> query = _db.Nannies; return(query); }
public IQueryable <Nanny> GetNanny([QueryString("nannyID")] int?nannyId) { var _db = new Nation1.Models.NannyContext(); IQueryable <Nanny> query = _db.Nannies; if (nannyId.HasValue && nannyId > 0) { query = query.Where(p => p.NannyID == nannyId); } else { query = null; } return(query); }