/// <summary> /// Add Security extension - Invokes the AddSecurityBuilder /// </summary> /// <param name="services">The services collection</param> /// <param name="settings">The settings <see cref="SecuritySettings"/></param> /// <param name="addSwaggerSecurity">Enable security in Swagger UI</param> /// <returns><see cref="IAddSecurityBuilder"/></returns> public static IAddSecurityBuilder AddSecurity(this IServiceCollection services, SecuritySettings settings, bool addSwaggerSecurity = false) { var securitySettings = settings; services.AddSingleton(securitySettings); AddSecurityBuilder.Create(securitySettings, IsJwtSchemeAdded, services, addSwaggerSecurity); IAddSecurityBuilder addSecurityBuilder = AddSecurityBuilder.TheInstance(); return(addSecurityBuilder); }
public static void Create(SecuritySettings securitySettings, bool isJwtSchemeAdded, IServiceCollection services, bool addSwaggerSecurity = false) { instance = new AddSecurityBuilder(securitySettings, isJwtSchemeAdded, services, addSwaggerSecurity); }