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

The Archive Base Latest Questions

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

Hey, I am trying to alter an attribute of an object. I am setting

  • 0

Hey, I am trying to alter an attribute of an object. I am setting it to the value of that same attribute stored on another table. There is a one to many relationship between the two. The product end is the one and the versions is the many. Right now, both these methods that I have tried have set all the products returned equal to the final version object. So, in this case they are all the same. I am not sure where the issue lies. Here are my two code snipets, both yield the same result.

            int x = 1
            IEnumerator<Product> ie = productQuery.GetEnumerator();
            while (ie.MoveNext())
            {
                ie.Current.RSTATE = ie.Current.Versions.First(o => o.VersionNumber == x).RSTATE;
                x++;
            }

and

             foreach (var product in productQuery)
            {

                product.RSTATE = product.Versions.Single(o => o.VersionNumber == x).RSTATE;
                x++;
            }

The versions table holds information for previous products, each is distinguished by the version number. I know that it will start at 1 and go until it reaches the current version, based on my query returning the proper number of products.

Thanks for any advice.

  • 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-15T06:46:34+00:00Added an answer on May 15, 2026 at 6:46 am

    Ok, so apparently it is altering all of them because product has a unique Identity column, so when I modify one instance of it, it changes them all. So, looks like it is back to the drawing board.

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

Sidebar

Related Questions

hey, following problem here: i have table with persons that have one location, if
Hey I'm trying to figure out how to convert a statement that works in
Hey I'm trying to return a message when there are no results for the
Hey guys I was trying to alter my tables column to take the current
Hey All! I'm trying to construct a query that is something like this: Where
I am using the gem 'geocoder'. I am trying to make an object that
Hey Im trying to understand the INT 10h, 13h (19) that writes a Character
Hey I am trying to place the 'title' attribute of a <section> tag inside
Hey guys i'm trying to build a little app that pulls in the users
Hey there! I'm trying to serialize data in AS3 but am running into a

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.