예제 #1
0
        /// <summary>
        /// Returns a configured <typeparamref name="TOptions"/> instance with the given <paramref name="name"/>.
        /// </summary>
        public virtual TOptions Get(string name)
        {
            name = name ?? Options.DefaultName;

            // Store the options in our instance cache
            return(_cache.GetOrAdd(name, () => _factory.Create(name)));
        }
 public TOptions Get(string name)
 {
     return(_cache.GetOrAdd(name, () => _factory.Create(name)).Validate(_serviceProvider));
 }