예제 #1
0
        public void Expect <TService, TImplementation>(ServiceLifetime lifetime = ServiceLifetime.Singleton)
        {
            ServiceMatch match = ServiceMatch.CreateMatch <TService>();

            AddNewMatch <TService>(match);
            match.Add <TImplementation>(lifetime);
        }
예제 #2
0
        public void Expect <TService, TPeerType>(string typeName, ServiceLifetime lifetime = ServiceLifetime.Singleton)
        {
            ArgumentNullException.ThrowIfNull(typeName);

            ServiceMatch match = ServiceMatch.CreateMatch <TService>();

            AddNewMatch <TService>(match);
            match.Add <TPeerType>(typeName, lifetime);
        }
        public void Expect <TService, TPeerType>(string typeName, ServiceLifetime lifetime = ServiceLifetime.Singleton)
        {
            if (typeName == null)
            {
                throw new ArgumentNullException(nameof(typeName));
            }

            ServiceMatch match = ServiceMatch.CreateMatch <TService>();

            AddNewMatch <TService>(match);
            match.Add <TPeerType>(typeName, lifetime);
        }
 public ExpectedCollectionBuilder Expect <TImplementation>(ServiceLifetime lifetime = ServiceLifetime.Singleton)
 {
     _match.Add <TImplementation>(lifetime);
     return(this);
 }