예제 #1
0
        public TH CreateRepositoryByConnStr <T, TH>(string ConnStr)
            where T : Entity
            where TH : IRepository <T>
        {
            var contextObj        = BuildDBContext.CreateJyDBContext(ConnStr, _SDBSettings.Value.dbType);
            var repositoryContext = getRepositoryContext(contextObj);

            return(_createRepository.Get <TH>(new object[] { repositoryContext }));
        }
예제 #2
0
        public TH CreateDefaultRepository <T, TH>()
            where TH : IRepository <T>
            where T : Entity
        {
            var contextObj        = BuildDBContext.CreateJyDBContext(_SDBSettings.Value.defaultConnectionString, _SDBSettings.Value.dbType);
            var repositoryContext = getRepositoryContext(contextObj);

            return(_createRepository.Get <TH>(new object[] { repositoryContext }));
        }
예제 #3
0
        //得到所有分库的Repository
        public List <TH> CreateAllRepository <T, TH>()
            where T : Entity
            where TH : IRepository <T>
        {
            var       contextList = BuildDBContext.CreateAllJyDBContext(_SDBSettings.Value.connectionList, _SDBSettings.Value.defaultConnectionString, _SDBSettings.Value.dbType);
            List <TH> rlist       = new List <TH>();

            contextList.ForEach((contextObj) => {
                var repositoryContext = getRepositoryContext(contextObj);
                rlist.Add(_createRepository.Get <TH>(new object[] { repositoryContext }));
            });
            return(rlist);
        }
예제 #4
0
 private JyDBReadContext getReadContext(string Id)
 {
     return(BuildDBContext.CreateJyDBReadContextFromId(Id, _SDBSettings.Value.connectionKeyList, _SDBSettings.Value.connectionReadList, _SDBSettings.Value.defaultReadConnectionString, _SDBSettings.Value.dbType));
 }
예제 #5
0
 public HashSet <string> GetConnectionStrings()
 {
     return(BuildDBContext.GetConnectionStrings(_SDBSettings.Value.connectionList, _SDBSettings.Value.defaultConnectionString, _SDBSettings.Value.dbType));
 }
예제 #6
0
 private TransactedConnection getContext(string Id)
 {
     return(BuildDBContext.CreateJyDBContextFromId(Id, _SDBSettings.Value.connectionKeyList, _SDBSettings.Value.connectionList, _SDBSettings.Value.defaultConnectionString, _SDBSettings.Value.dbType));
 }
 public OctopusController(BuildDBContext buildDBContext)
 {
     _buildDBContext = buildDBContext;
 }
 public BitbucketService(BuildDBContext buildDBContext)
 {
     _buildDBContext = buildDBContext;
 }
예제 #9
0
 public GithubService(BuildDBContext buildDBContext)
 {
     _buildDBContext = buildDBContext;
 }