Created
February 16, 2013 09:15
-
-
Save wullemsb/4966206 to your computer and use it in GitHub Desktop.
Exclude property from serialization, not working solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public class Product | |
{ | |
[NonSerialized] //NonSerialized works on field values | |
private int _id; | |
public int Id | |
{ | |
get{return _id;} | |
set{_id=value;} | |
} | |
[NonSerialized] //NonSerialized does not work on properties | |
public string Name{get;set;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment