예제 #1
0
 public BasePinata(string connectionString, Provider.Type provider)
 {
     Provider = provider;
     Command = CommandFactory.Create(provider);
     Repository = RepositoryFactory.Create(connectionString, provider);
     DynamicParameters = new Dictionary<string, string>();
 }
예제 #2
0
        public static IPinataRepository Create(string connectionString, Provider.Type type)
        {
            IPinataRepository repository = null;

            switch (type)
            {
                case Provider.Type.MySQL:
                    {
                        repository = new MySQL.PinataRepository(connectionString, Provider.MySQL);
                        break;
                    }
                case Provider.Type.MongoDB:
                    {
                        repository = new MongoDB.PinataRepository(new MongoUrl(connectionString));
                        break;
                    }
            }

            return repository;
        }
예제 #3
0
        public static ICommand Create(Provider.Type provider)
        {
            ICommand command = null;

            switch (provider)
            {
                case Provider.Type.MySQL:
                    {
                        command = new CommandSQL();
                        break;
                    }
                case Provider.Type.MongoDB:
                    {
                        MongoCustomSerializer();
                        command = new CommandMongo();
                        break;
                    }
            }

            return command;
        }
예제 #4
0
파일: Pinata.cs 프로젝트: rmattos/Pinata
 public Pinata(string connectionString, Provider.Type provider, params string[] samplePath)
     : base(connectionString, provider, samplePath)
 {
 }
예제 #5
0
파일: Pinata.cs 프로젝트: rmattos/Pinata
 public Pinata(string connectionString, Provider.Type provider)
     : base(connectionString, provider)
 {
 }