private void CheckThrowMemberBelongsToType(MemberInfo member, Type type) { if (!member.BelongsTo(type)) { var formatMember = $"{member.ReflectedType.GetPrettifiedName()}.{member.Name}"; var formatType = type.GetPrettifiedName(); throw new ArgumentException($"Member '{formatMember}' does not belong to type '{formatType}'"); } }