private IsTrueResponse CheckIfExistAndReturn(PhotoLikeEntity likeEntity) { var isTrueResponse = new IsTrueResponse(); if (likeEntity is not null) { isTrueResponse.IsTrue = true; } return(isTrueResponse); }
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."); }