I have a class :
public class Foo {
// here so serializer can materialize the class
public Foo(){
}
public Foo(string bar){
ImportantStuff = bar;
}
public string ImportantStuff { get; set;}
public string OtherBits{ get; set;}
public int eresting { get; set;}
}
How can i protect ImportantStuff
being set by anyone except the serializer (json.net/ EF) ?