TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rishi Tiwari
1.4k
326
630
How to bind Table data with related filters in IQueryable method
Jul 25 2020 12:44 AM
I have created this method need to access in my code
This is a my repositoty calss method
public
IQueryable<Job> GetJobs(
string
q =
""
,
int
pageIndex = 1,
int
pageCount = 20, JobsSortOptions sortBy = JobsSortOptions.jobId, JobStatus jobStatus = JobStatus.active, JobsSortByDate sortByDate = JobsSortByDate.date)
{
IQueryable<Job> jobs = from j
in
_context.Jobs
select j;
if
(!String.IsNullOrEmpty(q))
{
jobs = jobs.Where(j => j.JobTitle.Contains(q)
|| j.JobId.ToString().Contains(q)
|| j.ReqQual.Contains(q));
}
switch
(q)
{
case
"name_desc"
:
jobs = jobs.OrderByDescending(j => j.JobId);
break
;
case
"Date"
:
jobs = jobs.OrderBy(j => j.JobId);
break
;
case
"date_desc"
:
jobs = jobs.OrderByDescending(j => j.OpenDt);
break
;
}
//(pageIndex, pageCount)
return
jobs;
// var getJobDetails = _context.Jobs.Where(j => j.JobTitle.Contains(q));
//throw new NotImplementedException();
}
Reply
Answers (
4
)
How to download D: Drive Folder in MVC
What can be most efficient way of filtering data in DataTable?