public IServiceRepository Get(IServiceRepository parameter) { var comparer = new MemberComparer(new CompositeTypeComparer(TypeIdentityComparer.Default, AssignableFromTypeComparer.Default)); var policy = Whitelist.Any() ? (ISpecification <MemberInfo>) new AllowedPolicy(comparer, Whitelist.ToArray()) : new ProhibitedPolicy(comparer, Blacklist.ToArray()); return(parameter.RegisterInstance(policy.And <PropertyInfo>(_specification)) .RegisterInstance(policy.And <FieldInfo>(_specification))); }