public static IDac GetDAC() { if (_dac == null) { EFDac dc = new EFDac(); if (dc.EmpEntity == null) { dc.EmpEntity = new CBREmpEntities(); } _dac = dc; } return(_dac); }
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; } }