Environment versions
Network:
Windows 2008 Server
>I am learning how to create Model using EF (learning from various Pluralsight courses). So far what I understood is that the controller creates a model from EF and passes it to the View. And the examples I watched - so far - deal with only one table. But what if I need to use more that one table in the View? For example, a "main" table for the fields of the View and several tables used as look-ups? Does it mean that the controller then creates several models and passes to the View not one but several Models?
>
>TIA.
You should add multiple tables in the EF model and define the relationships between them. If, as the classic example, you have Customer, Order and OrderDetail tables then the EF Customer entity will then have a collection of Orders and each Order will have a collection of OrderDetails.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only