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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:44:01+00:00 2026-05-13T11:44:01+00:00

I have a project where I am using EFv4 to save data back to

  • 0

I have a project where I am using EFv4 to save data back to my repository. This is working as expected for the simple properties on my object but does nothing for the related objects.

For example, I have a User object and a related property Roles that is a collection of Role entities.

If I update the User’s lastActivity date and the Roles assigned to the user in my UI and then send the User object back to the repository to be updated I can see the new values in the User object for both lastActivity and the Roles, but when I call:

this.ObjectContext.ApplyCurrentValues(entitySet.Name.ToString(), entity);
this.ObjectContext.SaveChanges();

only the simple properties are saved like the lastActivity date, the Role changes are ignored.

Do I need to do something special update all referenced objects?

UPDATE:
I was searching the web a bit more and saw that someone mentioned that ApplyCurrentValues only affects the scalar properties. Still doesn’t change my original question, but it could explain why the related entities are not being updated. Microsoft’s documentation makes not mention of this from what I can see.

  • 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-13T11:44:02+00:00Added an answer on May 13, 2026 at 11:44 am

    I entered this with MSFT and it appears to be working as expected. Here is the quote from MSFT:

    ApplyCurrentValues does only work with
    the scalar properties on a single
    entity. What you are trying to
    accomplish would be easiest with
    self-tracking entities. Hopefully the
    switch to using these entities
    wouldn’t be too painful because you
    can just swpa which code generation
    template you are using (from the
    default one to the self-tracking
    entity one). You will not have to
    change your model at all, and
    hopefully the changes to your
    repository would be small.

    I have logged a documentation issue to
    clarify what ApplyCurrentValues does.
    Thank you for reporting this!

    Here is the referenced question:

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

Sidebar

Related Questions

I have a project using WCF which was working fine, but I moved the
I have a lein project (using cascalog--but that's not particularly important). I'm trying to
I have a legacy project using Rails 2.3.5 but I can't find with which
I have an project using Hibernate. This has a class named Question . Each
Suppose I have my project using Base SDK = 4 but set the Target
I have been working in a Government Project using EJBs . I have found
I'm working on a project using Maven as tool. Within the project I have
I have one project using NHibernate 1.2. I know it's old, but I've used
We have a project using Entity Framework 4.1 Code First for data storage. It
I have a project using DynamicJasper to create reports. It works fine so far,

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.