-
-
Notifications
You must be signed in to change notification settings - Fork 10
Controllers with and without caching
anton-martyniuk edited this page Sep 2, 2022
·
1 revision
Modern generic controllers use Modern generic services to perform CRUD operations.
To use Controller install the Modern.Controllers.DataStore.DependencyInjection
Nuget package and register it within Modern builder in DI:
builder.Services
.AddModern()
.AddControllers(options =>
{
options.AddController<CreateRequest, UpdateRequest, AirplaneDto, AirplaneDbo, long>();
});
Specify the type of create and update requests, dto entity model and primary key.
Controller requires one of modern services to be registered: regular one or with caching.