S
shapper
Hello,
I am creating a class "User" which will be used in Asp.Net 2.0 profile.
The class "User" has 2 properties: "Name" of type string and "Books"
which should be a collection of various "Book".
Then I want to be able to Add or Remove a "Book" from "Books"
collection under class "User".
Could someone tell me how to do this?
Here is the code I created. This is far from being working:
<Serializable()> _
Public Class User
' Name
Private _Name As String
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
' Books
Private _Books As Book
Public Property Books() As Book
Get
Return _Books
End Get
Set(ByVal value As Book)
_Books = value
End Set
End Property
End Class
...........................
<Serializable()> _
Public Class Book
' Title
Private _Title As String
Public Property Title() As String
Get
Return _Title
End Get
Set(ByVal value As String)
_Title = value
End Set
End Property
' Editor
Private _Editor As String
Public Property Editor() As String
Get
Return _Editor
End Get
Set(ByVal value As String)
_Editor = value
End Set
End Property
End Class
Thanks,
Miguel
I am creating a class "User" which will be used in Asp.Net 2.0 profile.
The class "User" has 2 properties: "Name" of type string and "Books"
which should be a collection of various "Book".
Then I want to be able to Add or Remove a "Book" from "Books"
collection under class "User".
Could someone tell me how to do this?
Here is the code I created. This is far from being working:
<Serializable()> _
Public Class User
' Name
Private _Name As String
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
' Books
Private _Books As Book
Public Property Books() As Book
Get
Return _Books
End Get
Set(ByVal value As Book)
_Books = value
End Set
End Property
End Class
...........................
<Serializable()> _
Public Class Book
' Title
Private _Title As String
Public Property Title() As String
Get
Return _Title
End Get
Set(ByVal value As String)
_Title = value
End Set
End Property
' Editor
Private _Editor As String
Public Property Editor() As String
Get
Return _Editor
End Get
Set(ByVal value As String)
_Editor = value
End Set
End Property
End Class
Thanks,
Miguel