// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddIdentity<ApplicationUser, IdentityRole>() .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders(); services.AddMvc(); // Add application services. services.AddTransient<IEmailSender, AuthMessageSender>(); services.AddTransient<ISmsSender, AuthMessageSender>(); // Get the configuration info j64HarmonyGateway j64Config = j64HarmonyGatewayRepository.Read(); services.AddSingleton<j64HarmonyGateway>(j64Config); // Get an auth token from the harmony "cloud" Hub myHub = new Hub(); bool connected = myHub.StartNewConnection(j64Config.Email, j64Config.Password, j64Config.HubAddress, j64Config.HubPort); // Add the hub as a service available to all of the controllers services.AddSingleton<Hub>(myHub); }
public FavoriteChannelController(j64HarmonyGateway j64Config, Hub hub) { this.j64Config = j64Config; myHub = hub; }
public CustomCommandController(j64HarmonyGateway j64Config, Hub hub) { this.j64Config = j64Config; myHub = hub; }
public HarmonyHubController(j64HarmonyGateway hubConfig, Hub hub) { this.j64Config = hubConfig; myHub = hub; }
public FirstTimeConfigController(j64HarmonyGateway hubConfig, Hub hub) { this.hubConfig = hubConfig; this.myHub = hub; }
public HubsAndGatewaysController(j64HarmonyGateway j64Config, Hub hub) { this.j64Config = j64Config; this.myHub = hub; }
public OAuthController(j64HarmonyGateway j64Config, Hub hub, IHostingEnvironment env) { this.j64Config = j64Config; this.myEnv = env; this.myHub = hub; }
public DeviceNamesController(j64HarmonyGateway j64Config, Hub hub) { myj64Config = j64Config; myHub = hub; }