public async Task SetItemUnlockableAsync(int id) { VerifyManagementPermission(); if (await _avatarItemRepository.IsLastInRequiredLayer(id)) { throw new GraException("Required layer needs an available item."); } if (await _avatarBundleRepository.IsItemInBundle(id, false)) { throw new GraException("Item is part of a default bundle."); } if (await _avatarItemRepository.IsInUse(id, true)) { throw new GraException("Item is in use by a participant."); } var item = await _avatarItemRepository.GetByIdAsync(id); item.Unlockable = true; await _avatarItemRepository.UpdateSaveAsync(GetClaimId(ClaimType.UserId), item); }