We help IT Professionals succeed at work.

Linq help

40 Views
Last Modified: 2015-10-23
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

Comment
Watch Question

Éric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:

Author

Commented:
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 ?
Senior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.