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
jaydeep shah
NA
44
4k
dynamic query in mvc 5
Oct 7 2015 8:25 AM
public ActionResult ifcondi(DirectItem di)
{
string getDirectId = HttpUtility.HtmlEncode(di.Id);
var data1 = (from c in db.RowItems
join a in db.categories on c.CategoryItemId equals a.category_id
join d in db.DirectItems on c.DirectItemId equals d.Id
// here plazma 60 is static ..i have many button plazma 60 ,, plazma 90 ,and so on
where d.ItemName == "plazma 60"
//insted of static item wht i have to add to make dynamik query
select new { c, a, d }).GroupBy(x => x.a.category_name).Select(y => new tempdata
{
CatagoryName = y.Key,
lists = y.Select(p => new a
{
name = p.c.ItemName
}).ToList()
}).ToList();
return View(data1.ToList());
}
Reply
Answers (
2
)
how to get selected row value in listview??
cheque printing