I am having some issues in database Umbraco MVC. The problem is that my records is deleted ok but sometimes they come back!
[HttpGet]
public ActionResult Delete(string kursusDeltagerId)
{
var db = ApplicationContext.DatabaseContext.Database;
db.Execute("DELETE FROM tblTilmeldtQueue WHERE cDeltagerId=@0", kursusDeltagerId);
return Redirect("/myview-oversigt/?id=4");
}
[HttpGet]
public ActionResult DeleteFromOrder(string kursusDeltagerId)
{
var db = ApplicationContext.DatabaseContext.Database;
db.Execute("DELETE FROM tblTilmeldt WHERE cDeltagerId=@0", kursusDeltagerId);
return Redirect("/myview-oversigt/?id=4");
}
I call delete from my view with the following code.
@Html.ActionLink("Fortryd", "Delete", "kursusOversigtSurface", new { kursusDeltagerId = @item.kursusDeltagerId }, null
Interesting situation, can you reproduce the bug ?
What version of Umbraco are you using ?
Maybe you can find something in UmbracoTraceLog ?
I delete rows like that
var query = new Sql().Select("*").From("Reviews").Where<ReviewDto>(x => x.Id == id);
var reviewFromDb = ApplicationContext.Current.DatabaseContext.Database.Fetch<ReviewDto>(query).FirstOrDefault();
var deletedReviewId = ApplicationContext.Current.DatabaseContext.Database.Delete(reviewFromDb);
I have been debugging and found out that the problem is not related to the database part.
The problem is that all actions sometimes is called twize. I have been looking at W3 traffic on the IIS server and here there was only one call to my actions.
My setup is that I have a RenderMvcController on the actual page with a SurfaceController and a RenderModel.
I have found a solution but am still interested in this issues.
Delete record petapoco
Hello,
I am having some issues in database Umbraco MVC. The problem is that my records is deleted ok but sometimes they come back!
I call delete from my view with the following code.
@Html.ActionLink("Fortryd", "Delete", "kursusOversigtSurface", new { kursusDeltagerId = @item.kursusDeltagerId }, null
My tables is created in the umbraco database.
Thanks in advance,
Best regards
Hi Jakob,
Interesting situation, can you reproduce the bug ?
What version of Umbraco are you using ?
Maybe you can find something in UmbracoTraceLog ?
I delete rows like that
Thanks,
Alex
Hi Alex,
Thanks for your reply.
I have been debugging and found out that the problem is not related to the database part.
The problem is that all actions sometimes is called twize. I have been looking at W3 traffic on the IIS server and here there was only one call to my actions.
My setup is that I have a RenderMvcController on the actual page with a SurfaceController and a RenderModel.
I have found a solution but am still interested in this issues.
Best regards, Jakob
is working on a reply...