Skip to content

How do I get DeclaringType from a given IObjectInfo #1949

@dennisdoomen

Description

@dennisdoomen

Discussed in #1944

Originally posted by AlexCrosby June 23, 2022
I'm refactoring a bunch of code that I have upgraded FluentAssertions from v5 to v6 and have come across an issue where IMemberInfo has been replaced with IObjectInfo (in this case the info variable).

.When(info => info != null
           && info.SelectedMemberInfo != null
           && info.SelectedMemberInfo.DeclaringType == foo);

I know that in IMemberInfo SelectedInfo has been flattened down, but IObjectInfo does not have a DeclaringType and I can see no way to get to it from IObjectInfo and I'm not entirely sure whether CompileTimeType is equivalent.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions