Example #1
0
        protected override object Create(TypeInfo parameter)
        {
            var property = _candidates.Select(parameter.GetProperty)
                           .FirstOrDefault(x => x != null && x.CanRead && x.GetMethod.IsStatic);
            var result = property != null?_singletons.Get(property) : null;

            return(result);
        }
Example #2
0
 /// <inheritdoc />
 public object ProvideValue(System.IServiceProvider serviceProvider)
 => _singletons.Get(serviceProvider.GetValid <IReflectionParser>()
                    .Get(_memberPath)
                    .AsValid <PropertyInfo>());