WebApiOptions.BusinessObject<T>() Method
Generates HTTP endpoints for the business object class passed as a parameter.
Namespace: DevExpress.ExpressApp.WebApi.Services
Assembly: DevExpress.ExpressApp.WebApi.v24.1.dll
NuGet Package: DevExpress.ExpressApp.WebApi
Declaration
Type Parameters
Name | Description |
---|---|
T | The business object class for which the Web API Service generates HTTP endpoints. |
Returns
Type |
---|
DevExpress.ExpressApp.WebApi.Services.BusinessObjectConfigurator<T> |
Remarks
The following code creates endpoints for the ApplicationUser and Contact business objects:
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