Ejemplo n.º 1
0
        public async Task <IEnumerable <Models.Entity.Student> > GetStudentsAsync(StudentSearch search)
        {
            //Expression<Func<Models.Entity.Student, bool>> expression = c =>
            //     string.IsNullOrEmpty(search.Name)
            //     || c.FirstName == search.Name;
            Expression <Func <Models.Entity.Student, bool> > expression = null;

            if (null != search)
            {
                Models.Entity.Student student = new Models.Entity.Student();
                where.Equal("FirstName", search.Name, "and");
                where.LessThanOrEqual(nameof(student.Birthday), search.Birthday, "and");
                expression = where.GetExpression();
            }
            return(await service.GetListAsync(expression));
        }