public ServiceResult DeleteAttribute(string UUID)//todo bookmark latest test this.
        {
            if (string.IsNullOrWhiteSpace(UUID))
            {
                return(ServiceResponse.Error("No id was sent."));
            }

            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            AttributeManager atm = new AttributeManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
            var res = atm.Get(UUID);

            if (res.Code != 200)
            {
                return(res);
            }

            var attribute = res.Result as TMG.Attribute;

            if (attribute.ValueType.EqualsIgnoreCase("ImagePath") == false)
            {
                return(atm.Delete(attribute, true));
            }

            string root = System.Web.HttpContext.Current.Server.MapPath("~/Content/Uploads/" + this.CurrentUser.UUID);

            string          fileName   = attribute.Image.GetFileNameFromUrl(); //todo get folder and file from attribute.Image => https://localhost:44318/Content/Uploads/8ac0adc1e7154afda15069c822d68d6d/20190226_082504appicon.png
            string          pathToFile = Path.Combine(root, fileName);
            DocumentManager dm         = new DocumentManager(Globals.DBConnectionKey, this.GetAuthToken(Request));

            if (dm.DeleteFile(attribute, pathToFile).Code != 200)
            {
                return(ServiceResponse.Error("Failed to delete file " + fileName));
            }
            DataFilter           filter     = this.GetFilter(Request);
            List <TMG.Attribute> attributes = atm.GetAttributes(this.CurrentUser.AccountUUID, ref filter)
                                              .Where(w => w.UUIDType.EqualsIgnoreCase("ImagePath") &&
                                                     w.Value == attribute.UUID &&
                                                     w.Image.Contains(fileName)).ToList();

            // Update attributes that are using this image.
            foreach (TMG.Attribute att in attributes)
            {
                // if (am.DeleteSetting(setting.UUID).Code != 200)
                //  return ServiceResponse.Error("Failed to delete image setting for file " + fileName);
                att.Image = "/assets/img/blankprofile.png"; // todo change image. Monetize?
            }

            var res1 = atm.Delete(attribute, true);

            ProfileManager profileManager = new ProfileManager(Globals.DBConnectionKey, Request.Headers.Authorization?.Parameter);
            var            tmp            = profileManager.GetProfile(CurrentUser.UUID, CurrentUser.AccountUUID, true);

            if (tmp.Code != 200)
            {
                return(tmp);
            }
            GreenWerx.Models.Membership.Profile profile = (Profile)tmp.Result;

            if (profile.Image.Contains(fileName))
            {
                profile.Image = "/assets/img/blankprofile.png";
            }

            return(profileManager.UpdateProfile(profile));
        }