public ActionResult Delete(int oid, Guid uid) { if (uid != AccessHelper.CurrentUserKey && !AccessHelper.IsMaster) { return(Redirect(Request.RawUrl)); } var db = new DB(); var obj = db.MapObjects.FirstOrDefault(x => (x.CreatorID == uid || AccessHelper.IsMaster) && x.ID == oid); if (obj != null) { db.MapObjects.DeleteOnSubmit(obj); db.SubmitChanges(); } return(Redirect(CMSPage.GetByType("ProfileZones").First().FullUrl + "?uid=" + uid)); }