11using System ;
2- //using System.Collections.Concurrent;
3- //using System.Collections.Generic;
42using System . Configuration ;
53using System . Linq ;
64using SharpRepository . Repository . Configuration ;
@@ -10,14 +8,6 @@ namespace SharpRepository.Repository
108{
119 public static class RepositoryFactory
1210 {
13- // private static readonly IDictionary<string, ISharpRepositoryConfiguration> _cache;
14- // private static ISharpRepositoryConfiguration _configuration = null;
15- //
16- // static RepositoryFactory()
17- // {
18- // _cache = new ConcurrentDictionary<string, ISharpRepositoryConfiguration>();
19- // }
20-
2111 public static IRepository < T , int > GetInstance < T > ( string repositoryName = null ) where T : class , new ( )
2212 {
2313 return GetInstance < T , int > ( repositoryName ) ;
@@ -50,22 +40,6 @@ public static object GetInstance(Type entityType, Type keyType, string repositor
5040
5141 public static IRepository < T , TKey > GetInstance < T , TKey > ( string configSection , string repositoryName ) where T : class , new ( )
5242 {
53- // ISharpRepositoryConfiguration configuration;
54- // var key = String.Format("{0}::{1}::{2}", typeof (T).FullName, typeof (TKey).Name, configSection);
55- // // first check cache
56- // if (_cache.ContainsKey(key))
57- // {
58- // configuration = _cache[key];
59- // }
60- // else
61- // {
62- // configuration = GetConfiguration(configSection);
63- // _cache[key] = configuration;
64- // }
65-
66- // if (_configuration == null)
67- // _configuration = GetConfiguration(configSection);
68-
6943 return GetInstance < T , TKey > ( GetConfiguration ( configSection ) , repositoryName ) ;
7044 }
7145
@@ -123,22 +97,6 @@ public static object GetInstance(Type entityType, Type keyType, Type key2Type, s
12397
12498 public static ICompoundKeyRepository < T , TKey , TKey2 > GetInstance < T , TKey , TKey2 > ( string configSection , string repositoryName ) where T : class , new ( )
12599 {
126- // ISharpRepositoryConfiguration configuration;
127- // var key = String.Format("{0}::{1}::{2}", typeof (T).FullName, typeof (TKey).Name, configSection);
128- // // first check cache
129- // if (_cache.ContainsKey(key))
130- // {
131- // configuration = _cache[key];
132- // }
133- // else
134- // {
135- // configuration = GetConfiguration(configSection);
136- // _cache[key] = configuration;
137- // }
138-
139- // if (_configuration == null)
140- // _configuration = GetConfiguration(configSection);
141-
142100 return GetInstance < T , TKey , TKey2 > ( GetConfiguration ( configSection ) , repositoryName ) ;
143101 }
144102
0 commit comments