Beispiel #1
0
        public void Contribute(IKernel kernel, ComponentModel model)
        {
            var actorFlag = IsActorType(model) &&
                            HasActorAttributeSet(model, kernel.GetConversionManager());

            model.SetProperty(FacilityConstants.ActorKey, actorFlag);
            if (actorFlag)
            {
                var actorServiceType = GetActorServiceTypeAttribute(model, kernel.GetConversionManager()) ?? typeof(ActorService);
                model.SetProperty(FacilityConstants.ActorServiceTypeKey, actorServiceType);
            }
        }
Beispiel #2
0
        public void Contribute(IKernel kernel, ComponentModel model)
        {
            var serviceNameFlag = HasServiceTypeNameAttributeSet(model);

            var statefulFlag = IsStatefulType(model) && HasStatefulAttributeSet(model, kernel.GetConversionManager());

            model.SetProperty(FacilityConstants.StatefulServiceKey, serviceNameFlag && statefulFlag);

            if (serviceNameFlag && statefulFlag)
            {
                model.SetProperty(FacilityConstants.ServiceTypeNameKey, model.GetAttribute(FacilityConstants.ServiceTypeNameKey));
            }
        }
Beispiel #3
0
 public static void SetProperty <T>(this ComponentModel model, T value)
 {
     model.SetProperty(typeof(T), value);
 }