public async Task <List <VoteQuestionOption> > GetListAsync(VoteQuestionOptionDto dto, CancellationToken token = default) { using (var db = new GuoGuoCommunityContext()) { return(await db.VoteQuestionOptions.Where(x => x.IsDeleted == false && x.VoteId == dto.VoteId && x.VoteQuestionId == dto.VoteQuestionId).ToListAsync(token)); } }
public async Task <VoteQuestionOption> AddAsync(VoteQuestionOptionDto dto, CancellationToken token = default) { using (var db = new GuoGuoCommunityContext()) { var entity = db.VoteQuestionOptions.Add(new VoteQuestionOption { VoteId = dto.VoteId, Describe = dto.Describe, VoteQuestionId = dto.VoteQuestionId, Votes = 0, CreateOperationTime = dto.OperationTime, CreateOperationUserId = dto.OperationUserId, LastOperationTime = dto.OperationTime, LastOperationUserId = dto.OperationUserId }); await db.SaveChangesAsync(token); return(entity); } }
public Task <List <VoteQuestionOption> > GetListIncludeAsync(VoteQuestionOptionDto dto, CancellationToken token = default) { throw new NotImplementedException(); }
public Task DeleteAsync(VoteQuestionOptionDto dto, CancellationToken token = default) { throw new NotImplementedException(); }