workflow foundation - Update EntityKey Reference in Entity Framework -
I have created an application using asp.net, the Entity Framework and the Windows Workflow Foundation, and hopefully everything works
My ASP.Net page should start the workflow that executes and updates a unit passed from the workflow to the page. Everything works well: I use the work pattern unit to share the reference between asp.net and WWF and my unit is updated successfully during the workflow ... except for a single unit which That my unit has been prepared as a reference to another entity.
Let's assume this case. The main unit is called the item in which the situation is called, which is a foreign key for another entity called status. When I make an item, I make it with the usual syntax like
item i = new item ();
Then I create the context of the position unit in this way:
i.StatusReference.EntityKey = New system. Data Antiquity ("myEntities.StatusSet", "Idestatus", state);
Where hardcounted is an integer value in the state workflow phase.
Every time I try to update this unit (item one) I follow these steps: a) I created the property (a new, created as the unit of operation for the following transaction GET) I get the unit from:
The unit is then attached to my reference EntityState is unknown
b) I update the status reference as before:
i Status Reference. Antitiki = New system Data Antiquity ("myEntities.StatusSet", "Idestatus", state);
c) I save changes in references like: ctx.SaveChanges ();
By using the vs2008 debugger, I can see the update unit and when the changes are saved I change all properties (revised date, item name and other startups), but the unit reference is still the original issue Gives points on
Can someone give me some help ?!
Comments
Post a Comment