public void InjectAll(IService service, IReadOnlyContainer container, object instance) { IEnumerable <ServiceFlag> flags = ServiceAttributeFinder.ProvideFlags(service.Flags, ServiceFlagConstants.TryInject); foreach (ServiceFlag flag in flags) { Type declarationType = DeclarationTypeProvider.ProvideDeclarartionType(flag.Member); object value = InjectValueProvider.ProvideValue(declarationType, container); ValueSetter.SetValue(flag.Member, instance, value); } }
public void InjectAll(IService service, object instance) { IEnumerable <ServiceFlag> flags = ServiceAttributeProvider.ProvideFlags(service.Flags, ServiceFlagConstants.Auto); foreach (ServiceFlag flag in flags) { Type declarationType = DeclarationTypeProvider.ProvideDeclarartionType(flag.Member); object value = AutoValueGenerator.GenerateValue(declarationType); MemberValueSetter.SetValue(flag.Member, instance, value); } }