Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created February 16, 2013 09:15
Show Gist options
  • Save wullemsb/4966206 to your computer and use it in GitHub Desktop.
Save wullemsb/4966206 to your computer and use it in GitHub Desktop.
Exclude property from serialization, not working solution
[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