Here is an example of what the code could look like from the Model
public static class SomeClass
{
// Description
public const string String1 = "String One"
public const string String2 = "String Two";
public const string String3 = " String Three";
public const string String4 = " String Four";
// Position
public const int String1Position = 0;
public const int String2Position = 1;
public const int String3Position = 2;
public const int String4Position = 3;
// Filter Ranges
public const int String2Minimum = 0100;
public const int String2Maximum = 0199;
public const int String3Minimum = 1000;
public const int String3Maximum = 1099;
public const int String4Unknown = 9999;
private class SomeClassData
{
public string Description { get; set; }
public int Position { get; set; }
public int FilterMinimum { get; set; }
public int FilterMaximum { get; set; }
}
}
I want to be able to populate the properties of this class for each of the different Descriptions, Positions and Filter Range(s) where the Description, the Position and the Filter are all related to each other.
SomeClassData.Description = "String Two";
SomeClassData.Position = 1;
SomeClassData.String2Minimum = 0100;
SomeClassData.String2Maximum = 0199;
Where the Description and the Position are being used in the Controller to be able to give the View the the properties to populate a drop down box using Javascript/JQuery.
The Filter Range(s) will be used by the controller to be able to accept the Position value from drop down box as a parameter from the ActionResult to generate linq queries to get the data back from the database.
I started to think that the best way to go would be to populate a List for each of the different types and then use each of the lists together but then would get messy trying to link the lists together properly.
I have this feeling I might need to use a Dictionary<string, object> or a Dictionary<int, object> where the object is the SomeClassData populated. Not sure if I’m way off on this thought or not at this point.
Yes you can use
Dictionary<string,SomeClassData>SelectLinq operator