Skip to main content
A newer version of this page is available.
All docs
V21.2

Add a Web API Project to an Existing Solution (CTP)

  • 2 minutes to read

Important

We do not recommend that you use the Web API in production code. We made this service available to gather feedback from anyone who considers it for future use.

This topic contains step-by-step instructions on how to add a Web API project to a .NET Core application.

  1. Use the Solution Wizard to add a Web API project to your application. Right-click the solution in the Solution Explorer and choose Add DevExpress Item | New Project….

    Solution

  2. Select the .NET Core platform and run the XAF Solution Wizard.

    Tutorial launch Wizard

  3. Choose the ASP.NET Core Web API Service option and specify the project name.

    Tutorial launch Wizard

  4. Select the eXpress Persistent Objects ORM for your application and click Next. The current Web API version does not support Entity Framework Core.

    Select ORM

  5. Optional. Choose the security options for your application and click Finish. See the following topic for details: Authentication in Web API projects.

    Select authentication

    The wizard adds the Web API project to your application.

    If you use the Sha512 algorithm to encrypt passwords in your application, set the PasswordCryptographer.SupportLegacySha512 property to true in the Web API project Startup.cs file for backward compatibility:

    File: MySolution.WebApi\Startup.cs

    public class Startup {
        // ...
        public void ConfigureServices(IServiceCollection services) {
            // ...
            PasswordCryptographer.SupportLegacySha512 = true;
            // ...
        }
    }
    
  6. Create endpoints and test the Web API.

See Also