0

The scenario:

I have a list of Language keywords for two languages: Language A and Language B. I want to create a left outer join that joins the two lists the on property: "Reference", i.e. I want a list of all "LanguageKeywords" in Language A and if the keyword exists in LanguageB, populate its "LanguageB" property value respectively...

public class LanguageKeyword
{
    public string Reference { get; set; }
    public string LanguageA { get; set; }
    public string LanguageB { get; set; }
}

Attempt:

var langA = new List<LanguageKeyword2>();
var langB = new List<LanguageKeyword2>();

var fullList = langA.GroupJoin(langB, a => a.Reference, b => b.Reference, (a, b) =>
    new LanguageKeyword2()
    {
        Reference = a.Reference,
        LanguageA = a.LanguageA,
        LanguageB = ???
    });

Thanks!

EaziLuizi
  • 1,557
  • 1
  • 16
  • 25
  • @AccessDenied - No, I have asked for Lamda syntax whereas other question did not. – EaziLuizi Sep 20 '18 at 05:21
  • Correct me if I'm wrong, but you do the same as in the following answer of specified thread https://stackoverflow.com/a/21584913/1099716 – Access Denied Sep 20 '18 at 05:23
  • @AccessDenied - Kind of, I have managed to do it with similar Selects/Manys, it's just such overkill, I will check the other answers on that thread though and hopefully come up with something clean and readable, thanks! – EaziLuizi Sep 20 '18 at 05:25

0 Answers0