I have a SQL which have already run fine
SELECT TOP (1000) [RecordHistoryID]
[Change]
,[WhatChanged]
,[ChangeByUserID]
,[ChangeDate],
REPLACE(WhatChanged, DIC.SourceText, DIC.Translation) AS TranslatedText
FROM [dbo].[RecordHistory] AS RH
LEFT JOIN [dbo].Dictionary DIC ON RH.WhatChanged LIKE '%Activity:%' + DIC.SourceText + '%']
But I have no idea how to write it in LINQ VB.NET with Contains condition. Currently, here is my code so far
From r In db.RecordHistories
Join u In db.Users On r.ChangeByUserID Equals u.UserID
Group Join dic In db.Dictionaries
Into group4 = Group
From grt In group4.DefaultIfEmpty
Select r, TranslatedText = grt.Translate
If I add Where function like Group Join dic In db.Dictionaries.Where(Function(x) r.Contains(x.SourceText))
it will not recognize "r" table and if I try Group Join dic In db.Dictionaries ON r.WhatChanged.Contains(dic.SourceText)
it will not valid either.
I can write it as a store but I will have to update a lot of logic. So is there any solutions if I want to group join on text contains condition ?