I have a C# class with properties in which I end up using this class a a collection of type List in another class.
What I want to do is just always set the Type property to be of value "3"
Should /Can this be done with the getter/setter or should I use the System.Component.DefaultValue .... attribute
public class ReportDefinition
{
public int Id { get; set; }
public string ReportGroupNameDef { get; set; }
public int SortOrder { get; set; }
public int ReportGroupId { get; set; }
[System.ComponentModel.DefaultValue(3)]
public int Type { get; set; }
}
I think that I would prefer not using this way [System.ComponentModel.DefaultValue(3)]