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
samba siva
1.4k
322
47.2k
Generic parameter for Linq where clause
Jan 23 2018 11:07 AM
I have the code like below:
string x="Hyderabad";
var result=(from pr in db.Properties
join slp in ShortListProp on pr.PropertyId equals slp.PropertyId into gj
from dta in gj.DefaultIfEmpty()
where pr.City == x
select pr)
I want to pass pr.city==x dynamically.
string x="Hyderabad";
var query=pr.city==x;
var result=(from pr in db.Properties
join slp in ShortListProp on pr.PropertyId equals slp.PropertyId into gj
from dta in gj.DefaultIfEmpty()
where (query)
select pr)
Reply
Answers (
5
)
ASP.Net MVC and using Linq to Sql
why SELECT clause comes after FROM clause in LINQ?