Beispiel #1
0
        public IDataAccess <T> CreateRepository(string connectionString, string type)
        {
            switch (type)
            {
            case "AccountRepository":
                return((IDataAccess <T>)AccountRepositoryMongo.AccountRepository(connectionString));

            case "ProductRepository":
                return((IDataAccessFindAll <T>)ProductRepositoryMongo.ProductRepository(connectionString));

            case "CustomerRepository":
                return((IDataAccess <T>)CustomerRepositoryMongo.CustomerRepository(connectionString));

            case "PrescriptionRepository":
                return((IDataAccess <T>)PrescriptionRepositoryMongo.PrescriptionRepository(connectionString));

            case "OrderRepository":
                return((IDataAccess <T>)OrderRepositoryMongo.OrderRepository(connectionString));

            case "SalesRepository":
                return((IDataAccess <T>)SalesRepositoryMongo.SalesRepository(connectionString));

            default:
                throw new ArgumentException(type + " Could not be found");
            }
        }
        public IDataAccess <T> CreateRepository(string connectionString, string type)
        {
            switch (type)
            {
            case "AccountRepository":
                return((IDataAccess <T>)AccountRepositoryMongo.AccountRepository(connectionString));

                break;

            case "ProductRepository":
                return((IDataAccess <T>)ProductRepositoryMongo.ProductRepository(connectionString));

                break;

            //case "CustomerRepository":
            //    return (IDataAccess<T>) CustomerRepositoryMongo.CustomerRepository(connectionString);
            default:
                throw new ArgumentException(type + " Could not be found");
            }
        }