Delete() public method

public Delete ( string tenant ) : void
tenant string
return void
コード例 #1
0
        public ActionResult DeleteResource(string themeName, string resource)
        {
            if (string.IsNullOrWhiteSpace(themeName) || string.IsNullOrWhiteSpace(resource))
            {
                return this.AjaxFail("Access is denied", HttpStatusCode.BadRequest);
            }

            try
            {
                var remover = new ResourceRemover(themeName, resource);
                remover.Delete();
            }
            catch (ResourceRemoveException ex)
            {
                return this.AjaxFail(ex.Message, HttpStatusCode.InternalServerError);
            }

            return Json(new {success = true}, JsonRequestBehavior.AllowGet);
        }
コード例 #2
0
ファイル: ThemeController.cs プロジェクト: frapid/frapid
        public ActionResult DeleteResource(string themeName, string resource)
        {
            if(string.IsNullOrWhiteSpace(themeName) ||
               string.IsNullOrWhiteSpace(resource))
            {
                return this.AccessDenied();
            }

            try
            {
                var remover = new ResourceRemover(themeName, resource);
                remover.Delete(this.Tenant);
            }
            catch(ResourceRemoveException ex)
            {
                return this.Failed(ex.Message, HttpStatusCode.InternalServerError);
            }

            return this.Ok();
        }