Rebel.Cms.Web.Editors.DataTypeEditorController.Delete C# (CSharp) Method

Delete() private method

private Delete ( HiveId id ) : System.Web.Mvc.JsonResult
id HiveId
return System.Web.Mvc.JsonResult
        public JsonResult Delete(HiveId id)
        {
            Mandate.ParameterNotEmpty(id, "id");

            using (var uow = BackOfficeRequestContext.Application.Hive.OpenWriter<IContentStore>())
            {
                uow.Repositories.Schemas.Delete<AttributeType>(id);
                uow.Complete();
            }
            
            //return a successful JSON response

            Notifications.Add(new NotificationMessage("Delete.Successful".Localize(this), NotificationType.Success));            
            var obj = new { message = "Success", notifications = Notifications };
            return new CustomJsonResult(() => obj.ToJsonString());
        }