public async Task <IEnumerable <SubjectDto> > GetAsync(CancellationToken token) { if (User.GetCountryClaim() != null) { return(null); } var query = new SubjectsTranslationQuery(); return(await _queryBus.QueryAsync(query, token)); }
public async Task <IEnumerable <SubjectDto> > GetAsync(SubjectsTranslationQuery query, CancellationToken token) { const string sql = @"select cs.Id, cs.Name as HeName, st.NameTranslation as EnName from sb.CourseSubject cs left join sb.SubjectTranslation st on cs.Id = st.SubjectId and st.LanguageId = (select Id from sb.AdminLanguage where Name = 'en')" ; using (var conn = _dapperRepository.OpenConnection()) { return(await conn.QueryAsync <SubjectDto>(sql)); } }
public async Task SubjectsTranslationQuery_Ok() { var query = new SubjectsTranslationQuery(); var _ = await _fixture.QueryBus.QueryAsync(query, default); }