Skip to main content
All docs
V24.2
.NET 8.0+
  • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WebApiOptions.BusinessObject(Type) Method

Generates HTTP endpoints for a type passed as a parameter.

Namespace: DevExpress.ExpressApp.WebApi.Services

Assembly: DevExpress.ExpressApp.WebApi.v24.2.dll

NuGet Package: DevExpress.ExpressApp.WebApi

#Declaration

public void BusinessObject(
    Type objectType
)

#Parameters

Name Type Description
objectType Type

A type for which the Web API Service generates HTTP endpoints.

#Remarks

The following code creates endpoints for the type of the user instance:

File: MySolution.WebApi\Startup.cs (MySolution.Blazor.Server\Startup.cs)

using MySolution.Module.BusinessObjects;
namespace MySolution.WebApi {
    public class Startup {
        public Startup(IConfiguration configuration) {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // ...
        public void ConfigureServices(IServiceCollection services) {
            // ...
            services.AddXafWebApi(Configuration, options => {
                options.BusinessObject<ApplicationUser>();
                options.BusinessObject<Contact>();
            })
            // in XPO applications, uncomment the following line
            // .AddXpoServices();
            // ...
        }
        // ...
    }
}
See Also