I've seen in several examples, each module contains a folder called Model, and all of them are independent. I mean the module A has no the same model classes than Module B.
I've implemented my database, and using Entity framework, but all my modules need to use several classes.
Is it OK to create a dll called data
(where contains the entities) and import to each module?
I think absolutely OK. So, you can have modules:
YourApplication
(just Shell bootstrapper)YourApplication.Infrastructue
(all shared interfaces, enums etc.)YourApplication.Data
(or YourApplication.DAL
) - project with Entity Framework's entitiesYourApplication.ModuleA
(with references to *.Infrastructure
and *.Data
)YourApplication.ModuleB
(with references to *.Infrastructure
and *.Data
)Prism recommends that ModuleA
should not know about ModuleB
, not that they should not use the same shared projects (Prism guide contains YourApplication.Infrastructure
itself, am I right? :) )
But in general - it's very probably, that you will need add Models to your modules (even if you have Entity Framework layer), because very often business models and database models aren't the same. But if you can use just database model - it will be great.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With