Bit.Api.Controllers.CiphersController.Favorite C# (CSharp) Method

Favorite() private method

private Favorite ( string id ) : System.Threading.Tasks.Task
id string
return System.Threading.Tasks.Task
        public async Task Favorite(string id)
        {
            var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), new Guid(_userManager.GetUserId(User)));
            if(cipher == null)
            {
                throw new NotFoundException();
            }

            cipher.Favorite = !cipher.Favorite;

            await _cipherService.SaveAsync(cipher);
        }