Link to home
Start Free TrialLog in
Avatar of Waterside
Waterside

asked on

Linq help

I'm trying to use this Linq which works well but fails if one of the tables is empty.  Any clues as to how to solve this ?

Dim tabs = dc.Mapping.GetTables().[Select](Function(o) New With { _
                           .TableName = o.TableName, .Type_ = o.RowType.Type, .IsEntity = o.RowType.IsEntity, _
                           .RowCount = dc.GetTable(o.RowType.Type).Cast(Of Object)().Count()}) _
                           .Where(Function(o) o.IsEntity).ToList()

Open in new window

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Avatar of Waterside
Waterside

ASKER

I don't see a Join ? Has something been lost in conversion to VB.net ? Do I need to join the table to the rowtype ?
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial