expressappframework-404398-data-security-and-safety-security-system-non-xaf-connect-to-ef-core-middle-tier-service-from-non-xaf-applications.md
The following steps outline how to connect a non-XAF .NET application to a database through the EF Core-based Middle Tier Security application.
Note
The technique described in this topic was not tested with .NET MAUI and Blazor WebAssembly clients. With these platforms, we recommend that you use our Web API Service on the backend as demonstrated in the following examples on GitHub:
Install the following NuGet package: DevExpress.ExpressApp.EFCore.
Create a Middle Tier client:
After the client successfully connects to the Middle Tier server and passes authentication, you can access security permissions for the current user.
You can use the Middle Tier Security as a database provider to access data through an EF Core DbContext or Object Space:
You need to dispose the Middle Tier client when it is no longer needed:
Tip
You can use DevExpress Template Kit for Visual Studio to create WinForms and WPF applications that implement the described approach.
See Also
Middle Tier Security with EF Core
Create an Application with EF Core Middle Tier Security
Add EF Core Middle Tier Security to an Existing WinForms Application
Backend Web API Service / REST API
Ways to protect database connection strings in desktop, web, or mobile clients