private IsTrueResponse CheckIfExistAndReturn(PhotoLikeEntity likeEntity)
        {
            var isTrueResponse = new IsTrueResponse();

            if (likeEntity is not null)
            {
                isTrueResponse.IsTrue = true;
            }

            return(isTrueResponse);
        }
Esempio n. 2
0
        private async Task <Unit> RemoveFromDatabaseAsync(PhotoLikeEntity entity)
        {
            await _photoLikeRepo.RemoveAsync(entity);

            if (await _photoLikeRepo.SaveAllAsync())
            {
                return(await Task.FromResult(Unit.Value));
            }

            throw new DatabaseException("Error occured while updating database.");
        }