Exemple #1
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));
            }
        }
 private static bool HasServiceTypeNameAttributeSet(ComponentModel model)
 {
     return(!string.IsNullOrEmpty(model.GetAttribute(FacilityConstants.ServiceTypeNameKey)));
 }