12345678910111213141516171819202122232425262728293031323334353637 |
- using Luticate2.Auth.Business;
- using Luticate2.Auth.DataAccess;
- using Luticate2.Auth.Middlewares;
- using Microsoft.AspNetCore.Builder;
- using Microsoft.Extensions.DependencyInjection;
-
- namespace Luticate2.Auth.Controllers
- {
- public static class LuticateExtensions
- {
- public static IServiceCollection AddLuticate(this IServiceCollection services)
- {
- services.AddSingleton<LuGroupsController>();
- services.AddSingleton<LuGroupsBusiness>();
- services.AddSingleton<LuGroupsDataAccess>();
-
- services.AddSingleton<LuUsersController>();
-
- services.AddDbContext<LuDatabaseContext>();
-
- return services;
- }
-
- public static IMvcBuilder AddLuticate(this IMvcBuilder builder)
- {
- // builder.AddApplicationPart(typeof(LuController).GetTypeInfo().Assembly)
- // .AddControllersAsServices();
- return builder;
- }
-
- public static IApplicationBuilder UseLuticate(this IApplicationBuilder app)
- {
- app.UseMiddleware<LuAuthMiddleware>();
- return app;
- }
- }
- }
|