public async Task <IReadOnlyList <Core.Entities.Survey> > ListWithQuestions(Guid surveyId) { var query = _dbContext.Set <Core.Entities.Survey>() .Include(s => s.SurveyQuestions) .Where(s => s.Id == surveyId); return(await query.ToListAsync()); }
public async Task <IReadOnlyList <Core.Entities.CompUserSurvey> > ListWithQuestions(Guid compUserSurveyId) { var query = _dbContext.Set <Core.Entities.CompUserSurvey>() .Include(s => s.CompUserSurveyDetails) //.ThenInclude(s => s.SelectedOptionId) .Where(s => s.Id == compUserSurveyId); return(await query.ToListAsync()); }
public async Task <IReadOnlyList <SurveyQuestion> > ListWithOptions(Guid surveyId) { var query = _dataContext.Set <SurveyQuestion>() .Include(s => s.QuestionOptions) .Where(s => s.SurveyId == surveyId); return(await query.ToListAsync()); }
public async Task <T> Create(T entity) { _dataContext.Set <T>().Add(entity); await _dataContext.SaveChangesAsync(); return(entity); }