Membership table


I have such test tables:

Which is the fastest query to get all TTag items for TRec?
Maybe this is possible to write some helper to get this "out the box"?
Currently, have this code, may be possible faster?

  Rec: TRec; // this is selected record
  RecTagList: TList<TRecTag>;
  RecTag: TRecTag;
  TagList: TList<TTag>; // I need this list
  RecTagList := ObjManager.Find<TRecTag>
                          .CreateAlias('RecId', 'Rec')
                          .Where(Linq['Rec.Id'] = Rec.RecId)
  for RecTag in RecTagList do

Also how to use Linq with TGUID? If indexes will have TGUID type.

IsEqualGUID(Linq['Rec.Id'], Rec.RecId.Id) isn't working

That's a good approach for TRec and TTag, yes.

About GUID, you can use GuidToSring:

Linq[''] = GuidToString(Rec.RecId.Id)