Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8751267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:00:50+00:00 2026-06-13T13:00:50+00:00

Here is an example of what the code could look like from the Model

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:00:51+00:00Added an answer on June 13, 2026 at 1:00 pm

    Yes you can use Dictionary<string,SomeClassData>

    var col = Dictionary<string, SomeClassData>
    {
        { "Desc1", new SomeClassData{Position =1, String2Minimum =0100, String2Maximum = 0199}},
        { "Desc2", new SomeClassData{Position =1, String2Minimum =0100, String2Maximum = 0199}},
        ....
    };
    

    Select Linq operator

    var fix = from entry in col 
              where entry.Key == "Desc1"
              select new entry.Value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is code example class A{ int i; public: A(int i) : i(i) {}
Here's some example code: class Obj attr :c, true def == that p '=='
Here's a contrived example of my code: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
Just some example code here, but I have lists of strings that I want
Hi I have a code example available here: http://jsbin.com/oxoweh My problem is that I
Before I explain, here's the example HTML code : [ Demo on jsFiddle here.
I am developing a application using PHP. Some example code is here. $url =
Here is an example of my code in a DAL. All calls to the
Here's an example I saw for some GLX code: display = XOpenDisplay(0); // ...
Here is an Example of the app. The essential code is in: golang-code/handler/handler.go (After

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.