Entity FrameWork Object not get updated for Reference Field ? RRS feed

  • Question

  • Hello

    Suppose I have relation for Order & customer. One customer has many orders.

    So in Order entity we can find field like





    Now in Order Object, If I Change CustomerID then Customer Object's CustomerID field not get updated.

    In Linq to Sql Class it is working properly.

    Here after every update If I call dataContextObj.ChangeTracker.Entities() or

    var dd = dataContext.Orders.ToList();

    dataContext.Entry(dd.First()).State ;

    then also CustomerID in Customer Object in Order Object get updated.

    Why it is not updated automaticaly.. What Kind of changes are required for this?

    Can anybody Help me for it?

    Thanking You in advance.

    Friday, February 1, 2013 9:01 AM