예제 #1
0
        public IQueryable <Nanny> GetNannies()
        {
            var _db = new Nation1.Models.NannyContext();
            IQueryable <Nanny> query = _db.Nannies;

            return(query);
        }
예제 #2
0
        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);
        }