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

  • Home
  • SEARCH
  • 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 673593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:36:46+00:00 2026-05-14T00:36:46+00:00

Doing my first SL4 MVVM RIA based application and i ran into the following

  • 0

Doing my first SL4 MVVM RIA based application and i ran into the following situation:
updating a record (EF4,NO-POCOS!!) in the SL-client seems to take place, but values in the dbms are unchanged. Debugging with Fiddler the message on save is (amongst others):

EntityActions.nil� b9http://schemas.microsoft.com/2003/10/Serialization/Arrays^HasMemberChanges�^Id�^ Operation�Update

I assume that this says only: hey! the dbms should do an update on this record, AND nothing more! Is that right?!

I ‘m using a generic repository like this:

public class Repository<T> : IRepository<T> where T : class
    {
        IObjectSet<T> _objectSet;
        IObjectContext _objectContext;

        public Repository(IObjectContext objectContext)
        {
            this._objectContext = objectContext;
            _objectSet = objectContext.CreateObjectSet<T>();
        }

        public IQueryable<T> AsQueryable()
        {
            return _objectSet;
        }
        public IEnumerable<T> GetAll()
        {
            return _objectSet.ToList();
        }
        public IEnumerable<T> Find(Expression<Func<T, bool>> where)
        {
            return _objectSet.Where(where);
        }
        public T Single(Expression<Func<T, bool>> where)
        {
            return _objectSet.Single(where);
        }
        public T First(Expression<Func<T, bool>> where)
        {
            return _objectSet.First(where);
        }
        public void Delete(T entity)
        {
            _objectSet.DeleteObject(entity);
        }
        public void Add(T entity)
        {
            _objectSet.AddObject(entity);
        }
        public void Attach(T entity)
        {
            _objectSet.Attach(entity);     
        }

        public void Save()
        {           
            _objectContext.SaveChanges();
        }
    }

The DomainService Update Method is the following:

[Update]
        public void UpdateCulture(Culture currentCulture)
        {
            if (currentCulture.EntityState == System.Data.EntityState.Detached)
            {
                this.cultureRepository.Attach(currentCulture);
            }
            this.cultureRepository.Save();
        }

I know that the currentCulture-Entity is detached. What confuses me (amongst other things) is this: is the _objectContext still alive? (which means it “will be”??? aware of the changes made to record, so simply calling Attach() and then Save() should be enough!?!?)

What am i missing?

Development Environment: VS2010RC – Entity Framework 4 (no POCOs)

Thanks in advance

  • 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-14T00:36:47+00:00Added an answer on May 14, 2026 at 12:36 am

    You are attaching the culture in the context, but you are not telling the context that the object has actually changed.

    The generated code I have on my machine is:

    public void UpdateDepartment(Department currentDepartment) {
        if ((currentDepartment.EntityState == EntityState.Detached)) {
            this.ObjectContext.AttachAsModified(currentDepartment, this.ChangeSet.GetOriginal(currentDepartment));
        }
    }
    

    What matters is the ‘AttachAsModified’.

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

Sidebar

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.