MongoServices 0.2.0
A Service/Repository Framework for mongoDB
|
00001 using System; 00002 using System.Collections.Generic; 00003 using System.Linq; 00004 using System.Text; 00005 using MongoDB.Driver; 00006 00007 namespace MongoServices 00008 { 00009 internal sealed class GlobalConfigContainer 00010 { 00011 #region Nested Singleton 00012 class Nested 00013 { 00014 // Explicit static constructor to tell C# compiler 00015 // not to mark type as beforefieldinit 00016 static Nested() 00017 { 00018 } 00019 00020 internal static readonly GlobalConfigContainer instance = new GlobalConfigContainer(); 00021 } 00022 00023 public static GlobalConfigContainer Instance 00024 { 00025 get 00026 { 00027 return Nested.instance; 00028 } 00029 } 00030 #endregion 00031 00032 #region MongoUrlProvider 00033 private Func<MongoUrl> _mongoUrlProvider = MongoServicesMongoUrlProvider.GetMongoUrl; 00034 public Func<MongoUrl> MongoUrlProvider 00035 { 00036 get 00037 { 00038 return _mongoUrlProvider; 00039 } 00040 set 00041 { 00042 _mongoUrlProvider = value; 00043 } 00044 } 00045 #endregion 00046 00047 } 00048 }