Using EF Db first, I have two tables:
Table1: AppId, AppName, AppGuid [PK]
Table2: AppGuid [FK], Description, Url
Can EF create a one entity from the both?
Meaning:
App:
AppId, AppName, AppGuid, Description, Url
Update
Thanks. I have made a view. Mapped it to EF. Now I get the following error: Error 2 Error 111: Properties referred by the Principal Role App must be exactly identical to the key of the EntityType MaMDBModel.App referred to by the Principal Role in the relationship constraint for Relationship MaMDBModel.FK_AppsData_App. Make sure all the key properties are specified in the Principal Role. D:\MaM\Dev\MamAdmin_1.0\MaMDBEntityFramework\MaMModel.edmx 768 11 MaMDBEntityFramework
this is my edmx:
You can create a VIEW using a JOIN between these 2 tables. After this you can use that View from EF.
Do this in SQL
And import ViewName in your Entity Framework model (as you would do with a normal SQL Table) and use it to query whatever you need
EDIT: Have a look at this link for more info http://www.mssqltips.com/sqlservertip/1990/how-to-use-sql-server-views-with-the-entity-framework/