Versions des environnements
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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement