Created AdminContext handling
This commit is contained in:
17
src/HopFrame.Web.Admin/ServiceCollectionExtensions.cs
Normal file
17
src/HopFrame.Web.Admin/ServiceCollectionExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using HopFrame.Web.Admin.Generators.Implementation;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace HopFrame.Web.Admin;
|
||||
|
||||
public static class ServiceCollectionExtensions {
|
||||
|
||||
public static IServiceCollection AddAdminContext<TContext>(this IServiceCollection services) where TContext : AdminPagesContext {
|
||||
services.AddSingleton(_ => {
|
||||
var generator = new AdminContextGenerator();
|
||||
return generator.CompileContext<TContext>();
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user