Beispiel #1
0
        public async Task <bool> CreateVoteAsync(Models.Forum.CRUD.Vote vote)
        {
            if (await _dbClient.UserHasAlreadyVotedOnPostAsync(vote.PostId, vote.CreatedByUserId))
            {
                return(false);
            }
            var newVote = _mapper.Map <Database.Entities.Forum.Vote>(vote);

            return(await _dbClient.CreateVoteAsync(newVote));
        }