Skip to content

Conversation

Rakkoc
Copy link

@Rakkoc Rakkoc commented Jun 19, 2017

remove if properties or their types has got ExcludeProxy Attribute (or dummy name)

remove if properties or their types has got ExcludeProxy Attribute (or dummy name)
@onionhammer
Copy link
Collaborator

What's the use-case of this; as opposed to just marking the properties as internal?

@Rakkoc
Copy link
Author

Rakkoc commented Jun 20, 2017

I use same dll with abstract (base) class and same type (they are nullable) use an other project and i can modify it. But they are partial i can add attribute in my project. And public it if i know name.

// remove if properties or their types has got ExcludeProxy Attribute (or dummy name)
properties = properties.Where(x =>
!x.CustomAttributes.Any(z => z.AttributeType.Name.Contains("ExcludeProxy")) && // Property
!x.PropertyType.CustomAttributes.Any(y => y.AttributeType.Name.Contains("ExcludeProxy")) // Type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid magic strings where possible.

An idea is to either compare to nameof(ExcludeProxy) or just compare where types contain typeof(ExcludeProxy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants