2023-04-12 11:53:55 +00:00
|
|
|
|
namespace KubernetesWorkflow
|
|
|
|
|
{
|
|
|
|
|
public class StartupConfig
|
|
|
|
|
{
|
|
|
|
|
private readonly List<object> configs = new List<object>();
|
|
|
|
|
|
|
|
|
|
public void Add(object config)
|
|
|
|
|
{
|
|
|
|
|
configs.Add(config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public T Get<T>()
|
|
|
|
|
{
|
2023-04-12 14:12:04 +00:00
|
|
|
|
var match = configs.Single(c => typeof(T).IsAssignableFrom(c.GetType()));
|
2023-04-12 11:53:55 +00:00
|
|
|
|
return (T)match;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|