public static IByContextSettings AddFromXmlFile(this IByContextSettings source, string fileName) { source.AddConfigurationDataProvider(new ConvertFromSectionDataProvider(()=> new XmlLoader().LoadFile(fileName), source)); return source; }
public static IByContextSettings AddFromRemoteWCFService(this IByContextSettings source) { source.AddConfigurationDataProvider(new ConvertFromSectionDataProvider(() => { IConfigurationDataService channel = new ChannelFactory<IConfigurationDataService>("ConfigurationData").CreateChannel(); return channel.GetConfigurationData(); },source) ); return source; }
public static INConfigSettings AddFromCollection(this INConfigSettings settings, MongoCollection<Section> collection) { if (!BsonClassMap.IsClassMapRegistered(typeof(Section))) { // Register Section in BsonClassMap to ignore automatically-added "_id" property BsonClassMap.RegisterClassMap<Section>(cm => { cm.AutoMap(); cm.SetIgnoreExtraElements(true); }); } var provider = new ConvertFromSectionDataProvider(() => collection.FindAll().ToList(), settings); return settings.AddConfigurationDataProvider(provider); }
public static IByContextSettings AddFromRawXml(this IByContextSettings source, string rawXml) { source.AddConfigurationDataProvider(new ConvertFromSectionDataProvider(()=> new XmlLoader().ReadXml(rawXml), source)); return source; }