Пример #1
0
        public TestDataModel Get(TestSearchModel param)
        {
            TestDataModel ret = null;

            if (param.pID != null)
            {
                if (param.pID.Trim().Length > 0)
                {
                    ret = this.data.Where(t => t.ID == param.pID).FirstOrDefault();
                }
            }

            return(ret);
        }
Пример #2
0
        public List <TestDataModel> List(TestSearchModel param)
        {
            List <TestDataModel> ret = new List <TestDataModel>();

            ret = this.data;

            if (param.pNome != null)
            {
                if (param.pNome.Trim().Length > 0)
                {
                    ret = ret.Where(t => t.Nome.ToUpper().Contains(param.pNome.ToUpper())).ToList();
                }
            }

            if (param.pEmail != null)
            {
                if (param.pEmail.Trim().Length > 0)
                {
                    ret = ret.Where(t => t.Email == param.pEmail).ToList();
                }
            }

            return(ret);
        }