Membership table

Hello, 


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?

var
  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)
                          .List;
  for RecTag in RecTagList do
    TagList.Add(RecTag.TagId);

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['Rec.id'] = GuidToString(Rec.RecId.Id)