Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Support [IgnoreDataMember] #9

Closed
Tornhoof opened this issue Mar 15, 2017 · 8 comments
Closed

Suggestion: Support [IgnoreDataMember] #9

Tornhoof opened this issue Mar 15, 2017 · 8 comments

Comments

@Tornhoof
Copy link

Currently the [IgnoreMember] Attribute is used to annotate properties which should be excluded.
I suggest to additionally support [IgnoreDataMember] (which is part of System.Runtime.Serialization) to do the same.
Reason: Easier migration from other serializers and it would not be necessary to have the MessagePack library in all the projects with base types for serialization.

@neuecc
Copy link
Member

neuecc commented Mar 15, 2017

Yes, [DataContract] can be [MessagePackObject], [DataMember(Order)] as Int Key, [DataMember(Name)] as String Key.

@AronParker
Copy link
Contributor

The issue is that IgnoreDataMember is not part of .NET standard 1.4, so currently it can't be supported. However I can imagine it being added easily when future versions of .NET standard get released / ported to.

@Tornhoof
Copy link
Author

Really?
If I look into the nuget package https://www.nuget.org/packages/System.Runtime.Serialization.Primitives/ then the type is contained in .net standard 1.3

@AronParker
Copy link
Contributor

Really?
If I look into the nuget package https://www.nuget.org/packages/System.Runtime.Serialization.Primitives/ then the type is contained in .net standard 1.3

When you open up the solution and you attempt to use it (which I tried), it gives you a warning. My source is this: .NET Standard 1.4 API. I suppose @neuecc would need to add that package as dependency in order for this to work.

It is trivial to implement, there are around 4 places where you would need to add checks for it and that's about it.

@Tornhoof
Copy link
Author

Yes, but since DataContract/member support is not yet in (atleast I get exceptions if I use DataMember(Order=1) instead of Key(1) and those attributes are actually define in System.Runtime.Serialization.Primitives I guess it will sooner or later show up anyway.

@AronParker
Copy link
Contributor

Sure, if neuecc wants to add it I would help him if he likes.

@neuecc
Copy link
Member

neuecc commented Mar 16, 2017

Thanks, I've added dependency(this is prepare workspace, not yet implemented).

@neuecc
Copy link
Member

neuecc commented Apr 2, 2017

IgnoreDataMember has been supported 1.1.2.

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

No branches or pull requests

3 participants