Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
How to use parameter array navigation properties EF linq ?
Rupesh Kahane
Jan 6 2017 2:14 AM
371
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Does Entity Framework Core meas Entity Framework 6.0 ?
How to convert sql to linq using C#