示例#1
0
 private void AddToConfigured <TOptions>(string type, Action <TOptions> action) where TOptions : class
 {
     if (!Configured.Contains(type))
     {
         Configured.Add(type);
         ServiceCollection.Configure(action);
     }
 }
示例#2
0
        public DIHelper Configure <TOptions>(string name, Action <TOptions> configureOptions) where TOptions : class
        {
            var serviceName = $"{typeof(TOptions)}{name}";

            if (!Configured.Contains(serviceName))
            {
                Configured.Add(serviceName);
                ServiceCollection.Configure(name, configureOptions);
            }

            return(this);
        }