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

  • Home
  • SEARCH
  • 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 978167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:01:04+00:00 2026-05-16T04:01:04+00:00

I call upon the VB ninjas out there. Here’s my situation. I need to

  • 0

I call upon the VB ninjas out there. Here’s my situation. I need to eventually be able to pass multiple models to a view. Currently I have a linq to sql class that, of course, has a bunch of generated model definitions. I need to make a model that implements multiple models. I somewhat understand how to do this in C#, but this project is testing my VB skillz.

Here’s some snippets from my linq to sql models. I need to combine these two into one model to pass to the view.

Article model:

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Articles")>  _
Partial Public Class Article
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _ArticleID As Integer

    Private _ClassID As System.Nullable(Of Integer)

    Private _Title As String

    Private _ShortDescription As String

    Private _LongDescription As String

    Private _ByLine As String

    Private _ArticleDate As System.Nullable(Of Date)

    Private _SchoolClass As EntityRef(Of SchoolClass)

Staff model:

<Global.System.Data.Linq.Mapping.TableAttribute(Name:="dbo.Staff")>  _
Partial Public Class Staff
    Implements System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged

    Private Shared emptyChangingEventArgs As PropertyChangingEventArgs = New PropertyChangingEventArgs(String.Empty)

    Private _StaffID As Integer

    Private _ClassID As Integer

    Private _PositionID As System.Nullable(Of Integer)

    Private _StaffName As String

    Private _Position As EntityRef(Of Position)

    Private _SchoolClass As EntityRef(Of SchoolClass)
  • 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-05-16T04:01:04+00:00Added an answer on May 16, 2026 at 4:01 am

    I might be missing the point of the question, but the first issue is that everything in these classes is Private. Maybe you’re just showing the backing fields?

    Assuming so, it seems like you just want to compose and expose some data from these objects through a presentation model:

    Public Class StaffAndArticleViewModel
        Private _Article As Article
        Private _Staff As Staff
    
        Public Sub New(ByVal a As Article, ByVal s As Staff)
            _Article = a
            _Staff = s
        End Sub
    
        ' now you just expose everything that the view requires
        ' for example:
    
        Public Property StaffName As String
            Get
                Return _Staff.Staff
            End Get
            Set(ByVal Value As String)
                _Staff.Staff = Value
            End Set
        End Property
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to call functions within a class upon instantiation of that
I have some Python code where I need to call upon a dictionary entry
I'm trying to do some complex math where I need to call upon some
How to call a view upon pressing a button in another view?
I was wondering how to click on any textbox and call upon an application
In the process of automating some code, I am looking to call upon a
In my application, upon clicking login in the login page, I have to call
I was wondering if anyone would know why I can't call upon one of
I need help with adding to a database. I want to call a javascript
I'm working on an android app that can call upon HP ePrint app to

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.