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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:57:06+00:00 2026-06-08T07:57:06+00:00

I have created dictionary and inserted 3 fields to it: Dictionary<string, Map> targets =

  • 0

I have created dictionary and inserted 3 fields to it:

Dictionary<string, Map> targets = new Dictionary<string, Map>();
targets.Add("Pláž - střed", new Map("Pláž - sever", "Vrak letadla", "Džungle", "Vrak letadla"));
targets.Add("Vrak letadla", new Map("Pláž střed", "nothing", "Roští", "nothing"));
targets.Add("Roští", new Map("nothing", "nothing", "Tenký lesík", "Vrak letadla"));

When I tried to get field targets[Pláž - sever], map constructor parameters contained "nothing", "nothing", "Tenký lesík", "Vrak letadla" – value of the last field, value is the same for 2nd and 3rd field. Can you please help me solve that problem?
I need 1st field to return its value, and not the value of the third field.

  • 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-08T07:57:07+00:00Added an answer on June 8, 2026 at 7:57 am

    Your question is a little odd to start with – but I suspect you’ll find that your Map class has static fields instead of instance fields. That would mean you’ve got one set of fields related to the type, and not to any particular instance of the type… so every time you overwrite the fields, you’re losing all your previous data.

    Just a guess though…

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

Sidebar

Related Questions

I have created dictionary object Dictionary<string, List<string>> dictionary = new Dictionary<string,List<string>>(); I want to
I have created a dictionary in Class A and would like to return the
I am trying to implement vectorization of a text file...I have created a dictionary
I have a Dictionary of objects I have created in smalltalk, which I am
I have defined a class Listener and created a dictionary of Listener objects. Each
all: I have 2 Dictionary objects d1 and d2. They are created separately at
I have a dictionary as follows: IDictionary<string, string> dict; How to create an enumerator
I have created a dictionary with a number of different bits of information all
I have a dictionary of 10000 Product/Colour/Size combinations which I have created with something
Weird question, but I have a dictionary created with StringComparer.OrdinalIgnoreCase, looks something like this

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.