public Result <List <StudentResultDTO> > GetStudents(StudentSearchDTO filter) { IQueryable <Student> students = (IQueryable <Student>)studentDAL.GetList(null); var result = students.WhereIf(filter.ClassID != 0, s => s.Class_ID == filter.ClassID) .WhereIf(filter.Name != null, s => s.User.Name == filter.Name) .WhereIf(filter.Surname != null, s => s.User.Surname == filter.Surname) .WhereIf(filter.Classname != null, s => s.Class_.Name == filter.Classname) .WhereIf(filter.UserID != null, s => s.UserID == filter.UserID) .Select(x => new StudentResultDTO { Name = x.User.Name, Surname = x.User.Surname, ClassID = x.Class_ID, UserID = x.UserID, Classname = x.Class_.Name }).ToList(); return(new Result <List <StudentResultDTO> >(false, "islem basarili", result)); }
public IQueryable <Student> GetList() { return(_iDAL.GetList()); }