using System; using Luticate2.Auth.Business; using Luticate2.Auth.DataAccess; using Luticate2.Auth.Middlewares; using Luticate2.Utils.Controllers; using Luticate2.Utils.Dbo.Basic; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; namespace Luticate2.Auth.Controllers { public static class LuAuthExtensions { public static IServiceCollection AddLuticateAuth(this IServiceCollection services, Action optionsDelegate) { services.AddLuticateUtils(optionsDelegate); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddDbContext(); return services; } public static IMvcBuilder AddLuticateAuth(this IMvcBuilder builder) { builder.AddLuticateUtils(); return builder; } public static IApplicationBuilder UseLuticateAuth(this IApplicationBuilder app) { app.UseLuticateUtils(); app.UseMiddleware(); return app; } public static object GetLuCurrentUser(this HttpContext context) { return context.GetLuItems()["currentUser"];//TODO } } }