Exemplo n.º 1
0
 public void AddVote(ApiVoteResponseModel item)
 {
     if (!this.Votes.Any(x => x.Id == item.Id))
     {
         this.Votes.Add(item);
     }
 }
        public virtual ApiVoteRequestModel MapResponseToRequest(
            ApiVoteResponseModel response)
        {
            var request = new ApiVoteRequestModel();

            request.SetProperties(
                response.BountyAmount,
                response.CreationDate,
                response.PostId,
                response.UserId,
                response.VoteTypeId);
            return(request);
        }
        public virtual ApiVoteResponseModel MapRequestToResponse(
            int id,
            ApiVoteRequestModel request)
        {
            var response = new ApiVoteResponseModel();

            response.SetProperties(id,
                                   request.BountyAmount,
                                   request.CreationDate,
                                   request.PostId,
                                   request.UserId,
                                   request.VoteTypeId);
            return(response);
        }