I’ve 2 tables with same column’s name, for example, both table A and table B has column’s name “Test”. I want to select column Test from both table A and B to entity class. How can I do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It sounds like you want the two entities of TableA and TableB merged into a new object. You can use the
.Select()extension method to create a new anonymous type, or into a class that you already have defined.The requirement here is that you’ve got to find a common attribute between TableA and TableB. Here I assume you’ve got something like
IDto match them together.Anonymous Type
Existing Class