Inner join in Entity Framework (EF) 5.0 (VS 2012)


Mobile Boy

Hello group,

Dim MyEFCustumer As Custumer

MyEFCustumer = DAL.DataAccess.Db.Database.SqlQuery(Of
ContactInfoLine)("Select * from Custumer").ToList.FirstOrDefault
The previous example is working fine because "ToList.FirstOrDefault" is
returning an instance of an existing EF class.

What should I do if I want an object having fields of 2 tables as return
type? In other words, is it possible to use for example an inner join of 2
tables and storing the result in an object.

What should I do to achieve this? By default, no EF classes represent an
object with fields of 2 tables.

Please provide a code example to illustrate it.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question