Skip to content

Controllers in memory

anton-martyniuk edited this page Sep 2, 2022 · 1 revision

Modern generic controllers use Modern generic services to perform CRUD operations. To use In Memory Controller install the Modern.Controllers.DataStore.InMemory.DependencyInjection Nuget package and register it within Modern builder in DI:

builder.Services
    .AddModern()
    .AddInMemoryControllers(options =>
    {
        options.AddController<CreateRequest, UpdateRequest, AirplaneDto, AirplaneDbo, long>();
    });

Specify the type of create and update requests, dto entity model and primary key.
Controller requires a modern in memory service to be registered.

Clone this wiki locally