linq2umbraco umbracodatacontext does not get updated
Hi.
I'm using the umbracodatacontext provider to do some linq stuff.
However I am having problems with the umbracodatacontext not beeing updated after I delete a node.
I have the following simple code that gets some data from the context:
using (var ctx = Backend.DomainModel.UmbracoObjects.MyUmbracoContextDataContext.Instance) { glhRepeater.DataSource = (from glh in ctx.GuidedLearningHours where glh.Client == currentId select glh); glhRepeater.DataBind(); }
This code is called during pageload and thats fine.
I then delete one of the GuidedLearninghours nodes via "regular" umbraco calls in this manner:
public void deleteGlh(int id) { var u = User.GetUser(0); var d = new Document(id); d.delete(); if (d.Published) { d.UnPublish(); umbraco.library.UnPublishSingleNode(d.Id); } d.delete(); umbraco.library.UpdateDocumentCache(d.Id); }
and then subsequently I run the previous code to populate my repeater. But the newly delete node is still there.
Now I have checked that I get a new umbracodatacontext since the old is removed from cache when the delete event is fired. I also tried to dispose the umbracodatacontext without luck.
I have a suspission that it is related to the umbraco.config file somehow not beeing updated.
linq2umbraco umbracodatacontext does not get updated
Hi.
I'm using the umbracodatacontext provider to do some linq stuff.
However I am having problems with the umbracodatacontext not beeing updated after I delete a node.
I have the following simple code that gets some data from the context:
This code is called during pageload and thats fine.
I then delete one of the GuidedLearninghours nodes via "regular" umbraco calls in this manner:
and then subsequently I run the previous code to populate my repeater. But the newly delete node is still there.
Now I have checked that I get a new umbracodatacontext since the old is removed from cache when the delete event is fired. I also tried to dispose the umbracodatacontext without luck.
I have a suspission that it is related to the umbraco.config file somehow not beeing updated.
Any sugestions?
Perhaps this topic can give you more info about the problem: http://our.umbraco.org/forum/developers/api-questions/14672-don't-get-my-node-back-with-linq-after-responseredirect.
Jeroen
This it definetly seem to be related to that. Did no one newer find a fix or workaround for it?
Unfortuanlty I never found a solution for this. I just stopped using linq2umbraco, because it was getting slow with 2000+ nodes.
Jeroen
damint #H5IS
I called d.delete();
before I did all the rest and that screwed it up
is working on a reply...