public static IServiceCollection CloudFoundryInfoConfigureServices(this IServiceCollection services, IConfiguration Configuration) { string port = Configuration.GetValue <string>("PORT", "PORT not configured."); string memoryLimit = Configuration.GetValue <string>("MEMORY_LIMIT", "MEMORY_LIMIT not configured."); string cfInstanceIndex = Configuration.GetValue <string>("CF_INSTANCE_INDEX", "CF_INSTANCE_INDEX not configured."); string cfInstanceAddr = Configuration.GetValue <string>("CF_INSTANCE_ADDR", "CF_INSTANCE_ADDR not configured."); CloudFoundryInfo info = new CloudFoundryInfo(port, memoryLimit, cfInstanceIndex, cfInstanceAddr); services.AddSingleton(info); return(services); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); var ci = new CloudFoundryInfo( Configuration.GetValue <string>("PORT", "PORT not configured."), Configuration.GetValue <string>("MEMORY_LIMIT", "MEMORY_LIMIT not configured."), Configuration.GetValue <string>("CF_INSTANCE_INDEX", "CF_INSTANCE_INDEX not configured."), Configuration.GetValue <string>("CF_INSTANCE_ADDR", "CF_INSTANCE_ADDR not configured.")); services.AddSingleton(ci); services.AddSingleton <IHealthContributor, TimeEntryHealthContributor>(); services.AddCloudFoundryActuators(Configuration); services.AddSingleton(sp => new WelcomeMessage(Configuration.GetValue <string>("WELCOME_MESSAGE", "WELCOME_MESSAGE not configured."))); services.AddDbContext <TimeEntryContext>(options => options.UseMySql(Configuration)); services.AddScoped <ITimeEntryRepository, MySqlTimeEntryRepository>(); services.AddSingleton <IOperationCounter <TimeEntry>, OperationCounter <TimeEntry> >(); services.AddSingleton <IInfoContributor, TimeEntryInfoContributor>(); }
public EnvController(CloudFoundryInfo cloudFoundryEnv) { _cloudFoundryEnv = cloudFoundryEnv; }
public EnvController(CloudFoundryInfo info) { _info = info ?? throw new ArgumentNullException(nameof(info)); }
public EnvController(CloudFoundryInfo cloud_foundry_info) { _cloudFoundryInfo = cloud_foundry_info; }
public EnvController(CloudFoundryInfo cloudFoundryEnv) { //CHANGE THAT DOES NOT MATTER _cloudFoundryEnv = cloudFoundryEnv; }
public EnvController(CloudFoundryInfo cloudFoundryInfo) { this._cloudFoundryInfo = cloudFoundryInfo; }
public EnvController(CloudFoundryInfo _cloudinfo) { cloudinfo = _cloudinfo; }
public EnvController(CloudFoundryInfo info) { _info = info; }
public EnvController(CloudFoundryInfo message) { _message = message; }