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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:50:33+00:00 2026-05-15T18:50:33+00:00

I have two complex dictionaries in the form Dictionary<string, Dictionary<string, Dictionary<string, List<string>>>> So as

  • 0

I have two complex dictionaries in the form

Dictionary<string, Dictionary<string, Dictionary<string, List<string>>>>

So as you see i’ve inner dictionaries. I want to write a generic recursive function which can merge two complex dictionaries of this form (or any other complex form of dictionaries), by calling itself passing the inner dictionaries (which are of different structure). This question also has another part. How to append one dictionary to other without looping?

A bit more explanation

This dictionary holds LIST OF MESSAGES sent BY A USER chatting in a SPECIFIC GROUP CHAT SESSION to a SPECIFIC USER (read the sentence and interpret the dictionary from the end). So i’ve two dictionaries of this form. As soon as i dispatch the message to a user i remove it from the dictionary. But i want to have history of messages. So before removing it i just make a copy by appending it to another dic which contains all the messages, in all chat sessions, from all users, to all users till now!

Note: I’m not blessed to use LINQ.

Thank you

NLV

  • 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-15T18:50:34+00:00Added an answer on May 15, 2026 at 6:50 pm

    If I dare be so bold, using dictionaries in this manner makes for extremely unmaintainable code.

    IMHO, The following class structure, or similar, would be much, much easier to understand and work with.

    public class User {
      public string Name {get;set;}
    
      // Sessions this user is participating in
      // (when you add to Session, add here too - Using a method to add both at same would be safest)
      public List<Session> Sessions {get;set;}
    
      // etc
    }
    
    public class Message {
      public User Sender {get;set;}
      public string Text {get;set;}
      // etc
    }
    
    public class Session {
      public string Title {get;set;}
      public List<User> Participants {get;set;}
      public List<Message> SentMessages {get;set;}
      public List<Message> UnsentMessages {get;set;}
    }
    
    public class ChatSystem {
       // All Users - Indexed by Name
       public Dictionary<string, User> Users {get; set;}
    
       // All Sessions - Indexed by Title
       public Dictionary<string, Session> Sessions {get; set;}
    }
    

    I know this isn’t addressing your specific request, but is attempting to address the essence of the request – being able to work with Users, Chat Sessions and Messages easily.

    Have fun!

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

Sidebar

Ask A Question

Stats

  • Questions 496k
  • Answers 496k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should get proper output. I tried you example just… May 16, 2026 at 11:35 am
  • Editorial Team
    Editorial Team added an answer Not a crazy idea at all, just know what you… May 16, 2026 at 11:35 am
  • Editorial Team
    Editorial Team added an answer According to http://codingforums.com/showthread.php?t=148936, you may have to parse the results… May 16, 2026 at 11:35 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have two complex (i.e. objects with string, int, double, List and other home
I have two complex objects of the same type. I want to compare both
Imagine I have two very complex but identical objects in c#, and I want
I have two complex rails (AR) queries coming from two different methods that I
I have two classes: Employee and EmployeeGridViewAdapter . Employee is composed of several complex
Say I have a unit test that wants to compare two complex for objects
I have a complex data structure (user-defined type) on which a large number of
I have a bit of a complex situation. I am building an iPhone app
i have two richtextboxes one below the other in my application.when the user start
I am experienced with Spring, but new to Spring Batch. Now I have the

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.