How to connect different data models to several databases within a single application with Entity Framework Core
This example demonstrates how to create custom XAF modules with custom business objects and logic that work with separate databases. These modules do not depend on each other and thus can be reused in other applications independently.
This EFCore example solution is based on the following tutorial: How to: Use Multiple Data Models Connected to Different Databases in Entity Framework Core.
Note that business classes linked to different ObjectSpaceProviders
are considered to be isolated from each other and thus cannot have direct links between them, e.g., an association between two classes. Consider using the How to prevent altering the legacy database schema when creating an XAF application or alternative solutions if you need interlinks between classes from different data stores.
Note For information on how to achieve the same functionality with XPO on .NET 6+ and .NET Framework, see the Readme.md files in the respective solution folders:
- ClassLibrary1DbContext
- PersistentClass1.cs
- XafModule1.cs
- ClassLibrary2DbContext
- PersistentClass2.cs
- XafModule2.cs
- Module.cs
(you will be redirected to DevExpress.com to submit your response)