Skip to main content
A newer version of this page is available. .
All docs
V22.1

Backend Web API Service / REST API

  • 3 minutes to read

Overview

The Solution Wizard creates a backend Web API Service (Web API) with integrated authorization and CRUD operations powered by Microsoft EF Core and DevExpress XPO ORM library. You can use OAuth2, JWT or custom strategies for authentication. The built-in Security System also filters out secured server data based on permissions granted to users.

The Web API creates URLs (endpoints) that allow you to perform CRUD operations from your non-XAF UI applications (for instance, .NET MAUI, JavaScript or Blazor clients). It uses ASP.NET Core OData 8.0 (OData v4.0) to support paging, filters, and other OData options. This service can be hosted as part of a Blazor Server project or as a standalone ASP.NET Core project.

The Web API utilizes Swagger (OpenAPI) to display and test endpoints. You can also test endpoints or consume the Web API with other platforms (for example, Postman, .NET, or JavaScript).

XAF Web API

The basic functions of our Web API Service (including the Solution Wizard) are available for FREE as part of our .NET App Security & Web API Service free offer. To register your free copy today, please visit: https://www.devexpress.com/security-api-free.

Additional services/benefits of our Web API Service ship as part of the DevExpress Universal Subscription and include:

  • Technical support and full source code
  • XAF’s administrative UI to manage users and roles at runtime using WinForms, WebForms, and Blazor apps
  • Localization functions (endpoints to obtain localized captions for classes, members, and custom UI elements)
  • Advanced/enterprise functions such as audit trail, endpoints to download reports, file attachments, check validation, etc.

See Also

Note

The Solution Wizard template for Web API .NET projects is available in Visual Studio 2022+ after you run the Universal Component Installer from the Download Manager.

How to Use

You can add the Web API to an existing Blazor Server project or create a new project with this service:

After you add the Web API to your project, you can use it as described in the following articles:

Authentication Options

The Web API supports all standard ASP.NET Core authentication techniques that you can specify in the MySolution.WebApi\Startup.cs (MySolution.Blazor.Server.Startup.cs) file. See the following topic for details: Authentication in Web API Projects.

Performance Considerations

You can disable logging to improve the Web API performance. To do this, set the LogLevel.DevExpress.ExpressApp option to None.

File: MySolution.Blazor.Server\appsettings.json (MySolution.Blazor.Server\appsettings.Development.json for debugging)

// ...
"LogLevel": {
    "Default": "Information",
    "Microsoft": "Warning",
    "Microsoft.Hosting.Lifetime": "Information",
    "DevExpress.ExpressApp": "None"
}
// ...

Use logging options other than None (for example, the DevExpress.ExpressApp = Debug) only for debugging purposes because logging reduces performance. See the following topic for more information: Log Files.

Use the Web API as the Middle Tier Server in WinForms Applications

You can also use the Web API as the Middle Tier Server in WinForms Applications. See the following topics for details: