Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8609435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:52:46+00:00 2026-06-12T03:52:46+00:00

I was reading this http://jcmartialarts.co.uk/CSharp/Using-Lambda-Expressions-To-LEFT-JOIN-Tables/43 but I cannot figure out how to do what

  • 0

I was reading this http://jcmartialarts.co.uk/CSharp/Using-Lambda-Expressions-To-LEFT-JOIN-Tables/43 but I cannot figure out how to do what I want. I have this expression:

Dim myData = db.Tbl_Exercises.Where(Function(x) x.Exercise_Employee_ID)

My Tbl_Exercise model has an Exercise_Type_ID. I want to use that ID to fetch the type of exercise description from my Tbl_Exercise_Type model which has an ExType_Desc property which is what I want to use in my application (in place of Tbl_Exercise.Exercise_Type_ID).

How can I do this?

Edit:

This is my model:

Public Class Tbl_Exercise

    <Key()> Public Property Exercise_ID() As Integer
    Public Property Exercise_Employee_ID() As Integer
    Public Property Exercise_Create_Date() As Date
    <ForeignKey("Tbl_Exercise_Type")>
    Public Property Exercise_Type_ID() As Integer
    Public Property Exercise_Duration() As Integer

    Public Overridable Property Tbl_Exercise_Type As Tbl_Exercise_Type

End Class

Public Class Tbl_Exercise_Type


    <Key()> Public Property ExType_ID() As Integer
    Public Property ExType_Desc() As String
    Public Property Exercise_Create_Date() As Date

    Public Overridable Property Tbl_Exercise() As ICollection(Of Tbl_Exercise)

End Class

Public Class ExerciseDbContext
    Inherits DbContext

    Public Property Tbl_Exercises As DbSet(Of Tbl_Exercise)
    Public Property Tbl_Exercise_Types As DbSet(Of Tbl_Exercise_Type)

End Class

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:52:47+00:00Added an answer on June 12, 2026 at 3:52 am

    See the translations below.


    // C#
    var OrderItems = Orders.GroupJoin(Items, o => o.OrderId, i => i.OrderId, (o, i) => new {o, i});
    
    ' VB.NET
    Dim OrderItems = Orders.GroupJoin(Items, Function( o ) o.OrderId, Function ( i ) i.OrderId, Function( o, i ) New With {o, i})
    

    // C#
    var Item = OrderItems.SelectMany(oi => oi.i.DefaultIfEmpty(), (o,i) => new {o.o, i});
    
    ' VB.NET
    Dim Item = OrderItems.SelectMany( Function( oi ) oi.i.DefaultIfEmpty(), Function ( o, i ) New With { o.o, i } )
    

    // C#
    var Qty = Item.Select(oi => oi.i.Qty);
    
    ' VB.NET
    Dim Qty = Item.Select( Function( oi ) oi.i.Qty )
    

    // C#
    var Item = OrderItems.SelectMany(oi => oi.i.DefaultIfEmpty(), (o,i) => new {o.o.OrderDate, i.Qty});
    
    ' VB.NET
    Dim Item = OrderItems.SelectMany( Function( oi ) oi.i.DefaultIfEmpty(), Function( o, i ) New With { o.o.OrderDate, i.Qty } )
    

    Complete Sample

    Class Order
    
        Private _orderId As Integer
        Public Property OrderId() As Integer
            Get
                Return _orderId
            End Get
            Set(ByVal value As Integer)
                _orderId = value
            End Set
        End Property
    
    End Class
    
    Class Item
    
        Private _orderId As Integer
        Public Property OrderId() As Integer
            Get
                Return _orderId
            End Get
            Set(ByVal value As Integer)
                _orderId = value
            End Set
        End Property
    
        Private _qty As Integer
        Public Property Qty() As Integer
            Get
                Return _qty
            End Get
            Set(ByVal value As Integer)
                _qty = value
            End Set
        End Property
    
    End Class
    
    Module Module1
    
        Sub Main()
    
            Dim Orders = New Order() { _
                New Order With {.OrderId = 1}, _
                New Order With {.OrderId = 2}, _
                New Order With {.OrderId = 3} _
            }
    
            Dim Items = New Item() { _
                New Item With {.OrderId = 1, .Qty = 1}, _
                New Item With {.OrderId = 3, .Qty = 1}, _
                New Item With {.OrderId = 4, .Qty = 1} _
            }
    
            Dim OrderItems = Orders.GroupJoin(Items, Function(o) o.OrderId, Function(i) i.OrderId, Function(o, i) New With {o, i})
            Dim Item = OrderItems.SelectMany(Function(oi) oi.i.DefaultIfEmpty(), Function(o, i) New With {o.o, i})
            Dim Qty = Item.Select(Function(oi) oi.i.Qty)
            ' Dim Item = OrderItems.SelectMany(Function(oi) oi.i.DefaultIfEmpty(), Function(o, i) New With {o.o.OrderDate, i.Qty})
        End Sub
    
    End Module
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this http://blogs.msdn.com/b/webdev/archive/2009/05/04/web-deployment-web-config-transformation.aspx but when I right click on web.config in Visual
I was reading this: http://www.openfeint.com/ofdeveloper/index.php/kb/article/000089 , and it seemed to make out that the
I'm reading this: http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.20.2 They say: Consider the example program: class Point { int
I was reading this http://blog.platformular.com/2012/03/20/load-google-chart-by-ajax-using-asp-net-mvc-and-jquery/ and this https://google-developers.appspot.com/chart/interactive/docs/gallery/areachart . How can I create an
I was reading this http://dev.w3.org/html5/markup/input.file.html , but I only found the accept attribute. I
I was reading this code ( http://jqueryui.com/droppable/#photo-manager ), but couldn't understand one specific line
Just reading this link: http://msdn.microsoft.com/en-us/library/aa833199.aspx It states: You cannot add users to roles in
I'm reading this: http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ I'm using backbone.js. I love it, though it requires too
EDIT: after reading this http://projects.scipy.org/numpy/ticket/1322 it seems that the NumPy version I am using
I'm reading this article http://www.codeguru.com/Csharp/.NET/net_security/authentication/article.php/c7415/ I still don't understand the concept of Principal (why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.