I have an object that will populate a grid with the ability to delete via a check box. The problem is that the objects are Grouped by a few properties which are common between them when they are created. For example I have the object
public class GroupedObject
{
Name { get; set; }
Level { get; set; }
Assignment { get; set; }
AssignmentDate {get; set; }
}
in this example when I save GroupedObjects from the gui, I have multiple objects with the Name property set differently, but Can assign them the same Level, Assignment, and AssignmentDate . So those three properties make the batch unique. I was wondering what the best way to create a unique identifier that groups those three pieces of information. I was thinking of something along the lines of
public class GroupedObject
{
....
public int BatchId
{
var batchString = string.format("{0}{1}{2}", Level, Assignment, AssignmentDate);
return batchString.GetHashCode();
}
}
This way on the grid I have a way of having something rendered in the background so that when I select one item in the group, the "batch of items" is selected.
Is there an alternate/standard way of handling something like this or is it up to the implementer.