I'm new in using MVC and LINQ to Entity. I don't know how to select column values from multiple tables with navigation property defined for each table.
Below is the structure of the tables:
Table: MasterTable
Fields: MasterID (PK), CaseNumber, Status, [OtherFields....]
Navigation Properties: DetailsTable, Clients
Table: DetailsTable
Fields: DetailsID (PK), MasterID (FK), InsuranceId (FK), DetailsStatus
Navigation Properties: MasterTable, Insurance
Table: Customers
Fields: CustID (PK), CustFName, CustFName, Address_id,Phone_id, MasterID (FK)
Navigation Properties: Order, Addresses, Phones
Table: Insurance
Fields: InsuranceId (PK), InsuranceName, Address1, Address2, ZipCode, State
Navigation Properties: Customers, DetailsTable, Addresses
Table: Addresses
Fields: Address_id (PK), Address1, Address2, ZipCode, State
Navigation Properties: State
Table: State
Fields: State_id (PK), StateAbbrev
Navigation Properties: Country
Table: Phones
Fields: Phone_id (PK), Home,Work,Mobile
How would I be able to pull the details data:
- CaseNumber, Status from the MasterTable
- InsuranceName, Address1, Address2, ZipCode, State from the Insurance table (based on the InsuranceId from the DetailsTable)
- DetailsStatus from the DetailsTable - CustFName, CustFName,Address1, Address2, ZipCode, State from the Customers table (*based on the Customers.MasterID = MasterTable.MasterID *)
Thanks.