Beispiel #1
0
        public IValidator <T> GetOrInit <T>(Specification <T> specification = null, string key = null) where T : class
        {
            var cacheKey = ResolveCacheKey <T>(key);

            return(_cache.GetOrAdd(cacheKey, _ => ValidatorCreator.Create(specification ?? _specificationsRepository.Get <T>())) as IValidator <T>);
        }