Connect the WinForms Data Grid to a Secure Backend with the DevExpress Web API Service (EF Core with OData)
The following example demonstrates the following:
- How to build a data model for application business entities and security policies with EF Core.
- How to securely load data from OData endpoints to a WinForms UI client using the DevExpress WinForms Data Grid control.
- How to activate authentication and authorization for the WinForms application using custom Web API endpoints (powered by the DevExpress Backend Web API Service).
- How to create a login form and customize its user interface elements based on access permissions.
-
Open WebApiExampleAll.sln. Register a DevExpress NuGet feed in the Visual Studio IDE. Skip this step if you have already registered the DevExpress NuGet feed.
-
Restore NuGet packages in the solution:
-
Run the OData.Server project. Right-click OData.Server in the Solution Explorer and select Debug | Start New Instance in the menu. Your default web browser will open. Starting the Web API server for the first time can take up to 20 seconds.
IMPORTANT
Do not close the web browser.
-
Run the WinForms.Client project. Right-click WinForms.Client in the Solution Explorer and select Debug | Start New Instance in the menu.
-
Click "Log in" to proceed. The password for Admin and User accounts is "QQQ". You can sort, filter, and group grid rows (records) as needed. Double-click a grid row to open the edit form and modify cell values:
- A Related Blog Post (general motivation, future considerations, etc.)
- JavaScript with DevExtreme + ASP.NET Core Web API/OData App
- JavaScript with Svelte + ASP.NET Core Web API/OData App
- Blazor WebAssembly App
- .NET MAUI (iOS/Android) App
(you will be redirected to DevExpress.com to submit your response)