Skip to content

DbContextModelLoader<T> class

Represents a IModelLoader implementation which allows to load the model from a DbContext object. Implements the Korzh.EasyQuery.Services.IModelLoader

public class Korzh.EasyQuery.Services.DbContextModelLoader<T>
: IModelLoader

Package: Korzh.EasyQuery.EntityFrameworkCore.Relational (targets: net5.0, netstandard2.0, netstandard2.1)

Assembly: Korzh.EasyQuery.EntityFrameworkCore.Relational.dll

NameTypeDescription
DbContextModelLoader(IServiceProvider services)voidInitializes a new instance of the Korzh.EasyQuery.Services.DbContextModelLoader`1 class.
DbContextModelLoader(IServiceProvider services, DbContextModelExtractorOptions options)voidInitializes a new instance of the Korzh.EasyQuery.Services.DbContextModelLoader`1 class.
NameTypeDescription
AdjustExtractorOptions(string modelId, DbContextModelExtractorOptions options)voidAllows to adjust the loader options in descendant classes
LoadModelAsync(DataModel model, string modelId)Task<bool>Loads the model from the DbContext object that we get from the DI container. NB: The model ID is not actually taking into account since the model is defined by a concrete DbContext type.