示例#1
0
 internal WhenDsl(TDsl innerDsl, Type guardConstraintType, FilterScope scope)
 {
     Scope         = scope;
     this.innerDsl = innerDsl;
     guardContraintRegistration = innerDsl.CreateTypeRegistration(guardConstraintType, EmptyActionDescriptor.Instance, EmptyControllerDescriptor.Instance, scope);
     //guardContraintRegistration = CreateTypeRegistration(guardConstraintType, EmptyActionDescriptor.Instance, EmptyControllerDescriptor.Instance);
 }
        public override void Build(Container container)
        {
            var factoryType  = container.GetFactoryForType(this.ServiceType.Type);
            var creator      = new AbstractFactoryCreator(factoryType);
            var registration = new TransientRegistration(creator);

            container.AddRegistration(new TypeKey(this.ServiceType.Type.TypeHandle, this.ServiceType.Key), registration);
        }
示例#3
0
文件: Apply.cs 项目: carcer/FluentMvc
        private static Apply CreateDsl(TransientRegistration constraintRegistration)
        {
            var dsl = new Apply();

            dsl.AddRegistration(constraintRegistration);

            return(dsl);
        }
示例#4
0
        public Person( IChangeTrackingService memento, ChangeTrackingRegistration registration, TransientRegistration transientRegistration )
            : base( memento, registration )
        {
            this.transientRegistration = transientRegistration;

            this.nameRejectCallback = ( pcr ) =>
            {
                this.CacheChangeOnRejectCallback( "property-name", this.Name, nameRejectCallback, null, pcr );
                this._name = pcr.CachedValue;
            };
        }
示例#5
0
        public Person(IChangeTrackingService memento, ChangeTrackingRegistration registration, TransientRegistration transientRegistration)
            : base(memento, registration)
        {
            this.transientRegistration = transientRegistration;

            this.nameRejectCallback = (pcr) =>
            {
                this.CacheChangeOnRejectCallback("property-name", this.Name, nameRejectCallback, null, pcr);
                this._name = pcr.CachedValue;
            };
        }
示例#6
0
 protected override void OnRegisterTransient( TransientRegistration transientRegistration )
 {
     base.OnRegisterTransient( this.transientRegistration );
 }
示例#7
0
        /// <summary>
        /// Called in order to register this instance as transient.
        /// </summary>
        protected virtual void OnRegisterTransient(TransientRegistration transientRegistration)
        {
            var autoRemove = transientRegistration == TransientRegistration.AsTransparent;

            ((IMemento)this).Memento.RegisterTransient(this, autoRemove);
        }
示例#8
0
 protected override void OnRegisterTransient(TransientRegistration transientRegistration)
 {
     base.OnRegisterTransient(this.transientRegistration);
 }