Пример #1
0
        public static IConfigurationBuilder AddMyConfiguration(this IConfigurationBuilder configuration, Action <MyConfigurationOptions> options)
        {
            _ = options ?? throw new ArgumentNullException(nameof(options));
            var myConfigurationOptions = new MyConfigurationOptions();

            options(myConfigurationOptions);
            configuration.Add(new MyConfigurationSource(myConfigurationOptions));
            return(configuration);
        }
Пример #2
0
 public MyConfigurationSource(MyConfigurationOptions options)
 {
     ConnectionString = options.ConnectionString;
     Query            = options.Query;
 }