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
Anjali
NA
7
21.4k
Passing records grouped using group by in LINQ to a MVC View
May 20 2014 12:20 AM
I have a table with products details and i want to group it by supplierId and pass the query result to a MVC view which throws error "
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1<>f__AnonymousType`2[System.Int32,System.Linq.IGrouping`2, but this dictionary requires a model item of type"
My table is:
ProductDetails
ProductId
SKU
SupplierId
Package
Price
I want to group it according to the supplier. Pls help me in how to pass the LINQ grouped query result to a MVC view. and how to display the recrds in groups in the View.
TIA.
Reply
Answers (
2
)
LINQ to SQL
Left join LINQ