Which of the following is the best way to implement a poco?
Option 1:
public class PocoOption1
{
public PocoOption1(int val1,string val2)
{
Val1=val1; Val2=val2;
}
public int Val1{get;private set;}
public int Val2{get;private set;}
}
Option 2:
public class PocoOption2
{
public int Val1{get;set;}
public int Val2{get;set;}
}
What are the potential pro-cons of each approach?? Does it matter? Some people say that a DTO should be set only once. Is it a rule or just an opinion??