Пример #1
0
 public static IDac GetDAC()
 {
     if (_dac == null)
     {
         MockDac dc = new MockDac();
         _dac = dc;
     }
     return(_dac);
 }
Пример #2
0
 public IDac GetDac(string dbtypr)
 {
     if (string.IsNullOrEmpty(myDBType))
     {
         throw new Exception("Database Server type rquired."); // No database server type provided, cannot continue;
     }
     if (myDBType.ToLower() == "ef")
     {
         return(EFDac.GetDAC());
     }
     else if (myDBType.ToLower() == "mock")
     {
         return(MockDac.GetDAC());
     }
     else
     {
         throw new Exception("Data Access to be implemented."); // No dac defined yet, cannot continue;
     }
 }