@@ -11286,25 +11286,23 @@ public static PropertiesAndFieldsSelector All(
11286
11286
serviceInfo = (GetServiceInfo)((m, r) => PropertyOrFieldServiceInfo.Of(m).WithDetails(details));
11287
11287
}
11288
11288
11289
- Func<Request, PropertyInfo, bool> isInjectable =
11290
- withNonPublic && withPrimitive ? ((r, p) => p.IsInjectable(true, true)) :
11291
- withNonPublic ? ((r, p) => p.IsInjectable(true, false)) :
11292
- withPrimitive ? ((r, p) => p.IsInjectable(false, true)) :
11293
- ((r, p) => p.IsInjectable(false, false));
11294
-
11295
11289
return req =>
11296
11290
{
11297
11291
var implType = req.ImplementationType;
11292
+ if (implType == null)
11293
+ return null;
11294
+
11295
+ // todo: @perf optimize allocations and maybe combine with fields below
11298
11296
var properties = implType
11299
11297
.GetMembers(x => x.DeclaredProperties, includeBase: withBase).ToArrayOrSelf()
11300
- .Match(req, isInjectable, ( r, p) => serviceInfo (p, r));
11298
+ .Match(serviceInfo, req, (si, r, p) => p.IsInjectable(withNonPublic, withPrimitive), (si, r, p) => si (p, r));
11301
11299
11302
11300
if (!withFields)
11303
11301
return properties;
11304
11302
11305
- var fields = implType // todo: @perf optimize allocations and maybe combine with properties
11303
+ var fields = implType
11306
11304
.GetMembers(x => x.DeclaredFields, includeBase: withBase).ToArrayOrSelf()
11307
- .Match(req, (r, f) => f.IsInjectable(withNonPublic, withPrimitive), (r, f) => serviceInfo (f, r));
11305
+ .Match(serviceInfo, req, (si, r, f) => f.IsInjectable(withNonPublic, withPrimitive), (si, r, f) => si (f, r));
11308
11306
11309
11307
return properties.Append(fields);
11310
11308
};
0 commit comments