@@ -183,28 +183,31 @@ await _ttvContext.FactFieldValues
183183 aittaModel . UserParticipatedDataset = await _ttvContext . FactFieldValues
184184 . Where ( ffv => ffv . DimUserProfile . OrcidId == orcidId && ffv . DimResearchDataset != null && ffv . DimResearchDatasetId > 0 && ffv . Show == true )
185185 . Include ( ffv => ffv . DimResearchDataset )
186- . ThenInclude ( rd => rd . DimKeywords )
186+ . ThenInclude ( rd => rd . FactKeywords )
187+ . ThenInclude ( kw => kw . DimKeyword )
188+ . Include ( ffv => ffv . DimResearchDataset )
189+ . ThenInclude ( rd => rd . DimDescriptiveItems )
187190 . Include ( ffv => ffv . DimResearchDataset )
188191 . ThenInclude ( rd => rd . FactDimReferencedataFieldOfSciences )
189192 . ThenInclude ( fdrfs => fdrfs . DimReferencedata )
190193 . Select ( ffv => new AittaResearchDataset
191194 {
192195 DatasetTitle = LanguageFilter (
193- ffv . DimResearchDataset . NameEn ,
194- ffv . DimResearchDataset . NameFi ,
195- ffv . DimResearchDataset . NameSv
196+ ffv . DimResearchDataset . DimDescriptiveItems . Where ( di => di . DescriptiveItemType == "name" && di . DescriptiveItemLanguage == "en" ) . Select ( di => di . DescriptiveItem ) . FirstOrDefault ( ) ,
197+ ffv . DimResearchDataset . DimDescriptiveItems . Where ( di => di . DescriptiveItemType == "name" && di . DescriptiveItemLanguage == "fi" ) . Select ( di => di . DescriptiveItem ) . FirstOrDefault ( ) ,
198+ ffv . DimResearchDataset . DimDescriptiveItems . Where ( di => di . DescriptiveItemType == "name" && di . DescriptiveItemLanguage == "sv" ) . Select ( di => di . DescriptiveItem ) . FirstOrDefault ( )
196199 ) ,
197200 Description = GetFirstNSentences (
198201 LanguageFilter (
199- ffv . DimResearchDataset . DescriptionEn ,
200- ffv . DimResearchDataset . DescriptionFi ,
201- ffv . DimResearchDataset . DescriptionSv
202+ ffv . DimResearchDataset . DimDescriptiveItems . Where ( di => di . DescriptiveItemType == "description" && di . DescriptiveItemLanguage == "en" ) . Select ( di => di . DescriptiveItem ) . FirstOrDefault ( ) ,
203+ ffv . DimResearchDataset . DimDescriptiveItems . Where ( di => di . DescriptiveItemType == "description" && di . DescriptiveItemLanguage == "fi" ) . Select ( di => di . DescriptiveItem ) . FirstOrDefault ( ) ,
204+ ffv . DimResearchDataset . DimDescriptiveItems . Where ( di => di . DescriptiveItemType == "description" && di . DescriptiveItemLanguage == "sv" ) . Select ( di => di . DescriptiveItem ) . FirstOrDefault ( )
202205 ) ,
203206 1
204207 ) ,
205- DatasetCreationDate = ffv . DimResearchDataset . DatasetCreated != null ? ffv . DimResearchDataset . DatasetCreated : null ,
206- Theme = ffv . DimResearchDataset . DimKeywords . Count > 0 ? ffv . DimResearchDataset . DimKeywords . Where ( kw => kw . Scheme == "Theme" ) . Select ( kw => kw . Keyword ) . ToList ( ) : null ,
207- Keywords = ffv . DimResearchDataset . DimKeywords . Count > 0 ? ffv . DimResearchDataset . DimKeywords . Where ( kw => kw . Scheme == "Avainsana" ) . Select ( kw => kw . Keyword ) . ToList ( ) : null ,
208+ DatasetCreationDate = ffv . DimResearchDataset . DatasetCreated != null ? ffv . DimResearchDataset . DatasetCreated : null ,
209+ Theme = ffv . DimResearchDataset . FactKeywords . Count > 0 ? ffv . DimResearchDataset . FactKeywords . Where ( fk => fk . DimKeyword . Scheme == "Theme" ) . Select ( fk => fk . DimKeyword . Keyword ) . ToList ( ) : null ,
210+ Keywords = ffv . DimResearchDataset . FactKeywords . Count > 0 ? ffv . DimResearchDataset . FactKeywords . Where ( fk => fk . DimKeyword . Scheme == "Avainsana" ) . Select ( fk => fk . DimKeyword . Keyword ) . ToList ( ) : null ,
208211 FieldsOfScience = ffv . DimResearchDataset . FactDimReferencedataFieldOfSciences . Select ( fdrfs => fdrfs . DimReferencedata . NameEn ) . ToList ( )
209212 } )
210213 . AsNoTracking ( ) . ToListAsync ( ) ;
0 commit comments