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 409395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:47:10+00:00 2026-05-12T17:47:10+00:00

I am using .NET 2.0. I have 2 objects one is: PhoneService and the

  • 0

I am using .NET 2.0. I have 2 objects one is: PhoneService and the other one is ChartOfAccount. The relationship between this to is many to many.

public class PhoneService
{
    private List<ChartAccount> chartAccounts
    private ChartAccount chartAccount

    public Int64 ID
    {
     get { return id; }
     set { id = value; }
    }

    public bool Add()
    { ... }

    public bool Update()
    { ... }
}

public class ChartAccount
{
    public Int64 ID
    {
     get { return id; }
     set { id = value; }
    }

    public bool Add()
    { ... }

    public bool Update()
    { ... }

    public bool Allocate()
    {
       // this will save data for the bridge table only
    }
}

Now my question, is it possible when you do this:

PhoneService service = new PhoneService();
service.ChartAccounts[0].ID = 5
service.ChartAccounts[1].ID = 10

Due to ChartAccounts is a collection, how do I attemp to put Allocate() so become like:
service.ChartAccounts.Allocate()

All I can think of is putting the Allocate() method in Service class instead. Any ideas?

Thanks

  • 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-12T17:47:11+00:00Added an answer on May 12, 2026 at 5:47 pm

    While this may not be the cleanest way , you could always just create a ChartAccounts class that only contains a list of chartaccounts and add the method to that class. The other option is to create a extension method on the chatAccount class to perform the allocate code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using .NET 2.0. I have 2 objects one is: PhoneService and the
I'm using .NET 3.5 and I have a class, A, marked as internal sealed
I'm using .NET 3.5. I have two string arrays, which may share one or
I'm working on an ASP.NET page, using VB.NET and I have this hierarchy: Page
Using VB.net (.net 2.0) I have a string in this format: record1_field1,record1_field2,record2_field3,record2_field1,record2_field2, etc... I
I have two websites, both using .Net framework 3.5. One website is hosting a
Using the .net framework you have the option to create temporary files with Path.GetTempFileName();
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
We have an application written in C#, using .NET Framework 3.0 or 3.5 or

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.