Пример #1
0
        public ICasted ToSelf()
        {
            CastableRegistration <TCastable> .RequiersNotInterface(ServiceType);

            As(Registration.CastTo = ServiceType);

            return(this);
        }
Пример #2
0
        public ICasted As <TService>() where TService : TCastable, new()
        {
            var castTo = typeof(TService);

            CastableRegistration <TCastable> .RequiersNotInterface(castTo);

            return(As(Registration.CastTo = castTo));
        }
Пример #3
0
        public IReusedWithin AsSingleton()
        {
            var type = Registration.CastTo.IsNull() ? ServiceType : CastTo;

            CastableRegistration <TCastable> .RequiersNotInterface(type);

            As(type);

            return(Registration.AsSingleton());
        }