Hello
Imagine that I have a class of people and each of these people has some friends.
I can't find the correct syntax to join a person with several friends.
Can you help?
Thanks
Imagine that I have a class of people and each of these people has some friends.
I can't find the correct syntax to join a person with several friends.
Can you help?
Thanks
VB.NET:
Public Class Amigos
Public Property nome As String
Public Property idade As Integer
Public Sub New(ByVal _nome As String, ByVal _idade As Integer)
Me.nome = _nome
Me.idade = _idade
End Sub
End Class
Public Class pessoa
Public Property id As Integer
Public Property nome As String
Public Property idade As Integer
Public Property sexo As Nullable(Of Char)
Public Property amigos As List(Of Amigos)
Public Sub New(ByVal _id As Integer, ByVal _nome As String, ByVal _idade As Integer, ByVal _sexo As Char, ByVal _amigos As List(Of Amigos))
Me.id = _id
Me.nome = _nome
Me.idade = _idade
Me.sexo = _sexo
Me.amigos = _amigos
End Sub
Public Shared Function getpessoas() As List(Of pessoa)
Dim listapessoas As New List(Of pessoa) From
{
New pessoa(1, "Paulo", 45, "M", (New Amigos("Joao", 10), New Amigos("Antonio", 10))
}
Return listapessoas
End Function
End Class
Last edited by a moderator: