Entity Framework VS2010 context.objectstatemanager."CHANGEOBJECTSTATE" doesn't exist?

sbornstein2
sbornstein2 used Ask the Experts™
on
I am trying something in VS2010 where I attach a entity to my context but then I try to simply do a ChangeObjectState and it doesn't exist anymore it seems.  How do I update a object?  I used to just do the following:

context.attach(address);
context.ObjectStateManager.ChangeObjectState(address, EntityState.Modified);
context.SaveChanges();



Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
That is not available UpdateObject:

  [OperationContract]
        public void SaveCustomerAddress(CustomerAddress address)
        {
            using (var context = new AdventureWorksEntities())
            {
                context.Attach(address);
                context.UpdateObject //doesn't exist
            }
        }

Author

Commented:
issue was I was targeting the 3.5 framework instead of 4.  Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial