Example #1
0
 public async Task <List <VoteQuestion> > GetListAsync(VoteQuestionDto dto, CancellationToken token = default)
 {
     using (var db = new GuoGuoCommunityContext())
     {
         return(await db.VoteQuestions.Where(x => x.IsDeleted == false && x.VoteId == dto.VoteId).ToListAsync(token));
     }
 }
Example #2
0
        public async Task <VoteQuestion> AddAsync(VoteQuestionDto dto, CancellationToken token = default)
        {
            using (var db = new GuoGuoCommunityContext())
            {
                var entity = db.VoteQuestions.Add(new VoteQuestion
                {
                    OptionMode            = dto.OptionMode,
                    VoteId                = dto.VoteId,
                    Title                 = dto.Title,
                    CreateOperationTime   = dto.OperationTime,
                    CreateOperationUserId = dto.OperationUserId,
                    LastOperationTime     = dto.OperationTime,
                    LastOperationUserId   = dto.OperationUserId
                });
                await db.SaveChangesAsync(token);

                return(entity);
            }
        }
Example #3
0
 public Task UpdateAsync(VoteQuestionDto dto, CancellationToken token = default)
 {
     throw new NotImplementedException();
 }
Example #4
0
 public Task <List <VoteQuestion> > GetListIncludeAsync(VoteQuestionDto dto, CancellationToken token = default)
 {
     throw new NotImplementedException();
 }