// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var tokenConfig = new TokenConfig(); Configuration.GetSection("JWT").Bind(tokenConfig); services.AddSingleton <TokenConfig>(tokenConfig); services.AddSingleton <ITokenHelper, TokenHelper>(); services.AddMvc(opt => { opt.EnableEndpointRouting = false; }); }
public TokenHelper(TokenConfig tokenConfig) { this.tokenConfig = tokenConfig; }