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

Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
Éric Moreau

8/22/2022 - Mon
Éric Moreau

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
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23