示例#1
0
        public static IDataAccess <T> GetInstance <T>(DataAccessTypes dat)
        {
            switch (dat)
            {
            case DataAccessTypes.Internal:
                return(new InternalDataAccess <T>());

            case DataAccessTypes.Database:
                throw new NotImplementedException();

            default:
                break;
            }
            return(null);
        }
示例#2
0
        public static IExampleDataAccess GetDataAccess(DataAccessTypes type)
        {
            const string connString = "Initial Catalog=ProphetsWay.Example;Data Source=localhost;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False";
            const string userName   = "******";
            const string userPass   = "******";

            switch (type)
            {
            case DataAccessTypes.Take1:
                return(new ExDataAccessTake1());

            case DataAccessTypes.Take2:
                return(new ExDataAccessTake2(connString));

            case DataAccessTypes.Take3:
                return(new ExDataAccessTake3(userName, userPass));

            default:
                return(null);
            }
        }