Created
August 4, 2009 20:51
-
-
Save tncbbthositg/161538 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Configuration; | |
using TASNET_Interface.IDAL; | |
namespace TASNET_Interface | |
{ | |
public class DALFactory : IDataAccess | |
{ | |
private static string _dal = ConfigurationManager.AppSettings["Dal"]; | |
private static IDataAccess _dataAccess; | |
public static IDataAccess DataAccess | |
{ | |
get | |
{ | |
if (_dataAccess == null) _dataAccess = GetDataAccess(); | |
return _dataAccess; | |
} | |
} | |
private static IDataAccess GetDataAccess() | |
{ | |
switch (_dal) | |
{ | |
case "Production": | |
return null; | |
case "Test": | |
default: | |
return new TestDAL.TestDataAccess(); | |
} | |
} | |
#region IDataAccess Members | |
public IEmployee Employee | |
{ | |
get { return DataAccess.Employee; } | |
} | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment