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); } }
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)); } }
public static void SetProperty <T>(this ComponentModel model, T value) { model.SetProperty(typeof(T), value); }