Example #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>();
 }
Example #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;
        }
Example #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;
        }
Example #4
0
 public Pinata(string connectionString, Provider.Type provider, params string[] samplePath)
     : base(connectionString, provider, samplePath)
 {
 }
Example #5
0
 public Pinata(string connectionString, Provider.Type provider)
     : base(connectionString, provider)
 {
 }