I have a class that serves purely as a data container for passing values from a parsing class to a class responsible for saving the data. I have been wondering whether it would be more appropriate as a struct. The class definition is below.internal class DataContainer{    public string FirstName { get; set; }    public string LastName { get; set; }    public Guid PersonId { get; set; }    public string Address { get; set; }    public string PhoneNumber { get; set; }    public string Sensor1Name { get; set; }    public IEnumerable<Tuple<double?, int>> Sensor1Readings { get; set; }    public string Sensor2Name { get; set; }    public IEnumerable<Tuple<double?, int>> Sensor2Readings { get; set; }}The parser uses an iterator block to turn a large csv file into approximately 6000 DataContainers. As they are created, each DataContainer is passed to the SaveContainer. The SaveContainer immediately reads the values and discards each object. Finally, the SaveContainer saves all the values to the database:internal class FileParser{    // Much yak shaving...    private IEnumerable<DataContainer> GetFileData()    {        using (StreamReader readFile = new StreamReader(this.FilePath))        {            string tableData = null;            while ((tableData = readFile.ReadLine()) != null)            {                var sensor1Data = readFile.ReadLine();                var sensor2Data = readFile.ReadLine();                DataContainer currentData = this.CreateDataContainer(tableData, sensor1Data, sensor2Data);                yield return currentData;            }        }    }    private void CollectData()    {        SaveContainer saveContainer = new SaveContainer();        foreach (var data in this.GetFileData())        {            saveContainer.AddData(data);        }        saveContainer.Save();    }}I have read Microsoft's Choosing Between Class and Struct guidelines and I think that I mostly understand them (enough to say that this type does not meet the qualifications). I've also read some related Stack Overflow answers including this and this. They seem to offer a wide variety of opinions on the matter. I have no specific need to change the type definition, but its use is so particular and basic that a class seems unnecessarily complex. Would changing this class to a struct offer any compelling advantages or disadvantages?
Should this container be a struct or a class?
c#;classes;serialization
Keep it a classThe linked MSDN guideline says so itself:X AVOID defining a struct unless the type has all of the following characteristics:it has an instance size under 16 bytesIt should be pretty clear that DataContainer is going to be much larger than 16 bytes.One of the reasons this is a concern is that structs are stored on the stack.  The default .NET thread stack size is 1MB, so in an extreme case, a struct which is too large could get you a StackOverflowException without any recursion required.