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

  • Home
  • SEARCH
  • 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 6796317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:27:10+00:00 2026-05-26T18:27:10+00:00

I want to create a business entity. I want to store additional information with

  • 0

I want to create a business entity. I want to store additional information with each property

e.g.

    Public Class BE
    {
        private string _fundCity;

        public string FUND_CITY 
        {
            get { return _fundCity; }
            set { _fundCity = value; }
        }
    }

For FUND_CITY i want to store “StartOffSet” and “EndOffSet” values in BE.
Can some one help.

  • 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-05-26T18:27:11+00:00Added an answer on May 26, 2026 at 6:27 pm

    If you want to have properties that are directly related to FUND_CITY then normally you would make it an object in its own right and add the properties to the new object, and you can still store it in your object BE as you are now.

    If you want FUND_CITY to remain as a string, then you must add StartOffset and EndOffset as properties on the BE class, just as you have with FUND_CITY. I would give you an example but you haven’t specified what types those two properties are.

    EDIT:

    It sounds like what you need is a wrapper class with a shot of generics. If you want to track StartOffset and EndOffset for every property on BE, then first create a generic class that will be used for each property in BE:

    public class MyProperty<T> 
    {
        public MyProperty(T propertyValue)
        {
            PropertyValue = propertyValue;
        }
    
        public int StartOffset { get; set; }
        public int EndOffset { get; set; }
    
        public T PropertyValue { get; set; }
    }
    

    PropertyValue is used to hold (or wrap) the actual value of the property. Your class BE then changes to look like this:

    public class BE
    {
        public MyProperty<string> FUND_CITY { get; set; }
    
        public MyProperty<int> SomeOtherProperty { get; set; }
    }
    

    you can then use it like this:

    class Program
    {
        static void Main(string[] args)
        {
    
            var myBE = new BE();
            myBE.FUND_CITY = new MyProperty<string>("some random string value") { StartOffset = 0, EndOffset = 10 };
            myBE.SomeOtherProperty = new MyProperty<int>(999);
    
            Console.ReadKey();
        }
    }
    

    If you want to go still further and keep a list of these, then you can use the inbuilt generic List<T> type, but then you have a small issue: the List<T> wants all its contents to be of the same type. You can get round this either by using a base class, or by just casting everything in the List<T> to type object. Here is an example of using the base class, it has a small change from the code above:

    public class MyPropertyBase
    {
        public int StartOffset { get; set; }
        public int EndOffset { get; set; }
    }
    
    public class MyProperty<T> : MyPropertyBase
    {
        public MyProperty(T propertyValue)
        {
            PropertyValue = propertyValue;
        }
    
        public T PropertyValue { get; set; }
    }
    
    public class BE
    {
        public MyProperty<string> FUND_CITY { get; set; }
    
        public MyProperty<int> SomeOtherProperty { get; set; }
    
        public List<MyPropertyBase> MyDataPoints { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a business object based on a NSDictionary . The reason
I want to create a new business application using the Django framework. Any suggestions
In Business Intelligence Developer Studio, I'm wondering why one would want to create a
I want to create a custom database within Adobe Business Catalyst. I have an
i want to create a class library project which will my data access layer
I want to create a class which stores DataTables, this will prevent my application
I want to create a trigger to check what is being deleted against business
I've created some business classes using OO Perl and I want to make sure
i want create multiple search where statement $where_search is a multiple condition from post
I want create wordpress website into which I want create user management... That means

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.