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
Rupesh Kahane
102
19.1k
4.2m
How to use parameter array navigation properties EF linq ?
Jan 6 2017 2:14 AM
I have a table structure with relationship in between three tables.
I have added edmx file into my project as below.
I would like to use parameter array navigation properties entity framework using linq.
I have written some code in controller like
<Expression> parames1 = v => v.LoginInfo;
<Expression> parames2 = v => v.LoginInfo.UserDetail;
<Expression> [] paramesArray =
new
Expression>[] { parames1, parames2 };
var userPost = UnitoffWork.UserPostRepository.GetAll(navigationProperties: paramesArray).Select(u =>
new
HomeViewModel(u));
I am not able to implement this.
getting some errors like
1. parames1 does not exist.
2. can not create an instance of abstarct class or interface 'System.Linq.Expressions.Expression'
Please suggest how can i get all data in single variable from mutliple tables.
Thanks
Reply
Answers (
3
)
Does Entity Framework Core meas Entity Framework 6.0 ?
How to convert sql to linq using C#