G
Guest
I developed a custom file attachments class for an application and from the
UI the user can choose to upload attachments. There is a add method that
takes a FileAttachmentCollection object, runs a for each, and uploads each
attachment. I was thinking that it would be nice to allow it to be Nullable
if they happen not choose to upload attachments when submitting data. When I
try Public Sub Add(attachments As Nullable(Of FileAttachmentCollection) I
get: Type argument 'BusinessLogicLayer.FileAttachmentCollection' does not
satisfy the 'Structure' constraint for type parameter 'T'. I am doing the
following for my collection.
Public Class FileAttachmentCollection
Inherits System.Collections.ObjectModel.Collection(Of FileAttachment)
End Class
Any thoughts on how to correct this error?
Is there an easy way to fix this?
UI the user can choose to upload attachments. There is a add method that
takes a FileAttachmentCollection object, runs a for each, and uploads each
attachment. I was thinking that it would be nice to allow it to be Nullable
if they happen not choose to upload attachments when submitting data. When I
try Public Sub Add(attachments As Nullable(Of FileAttachmentCollection) I
get: Type argument 'BusinessLogicLayer.FileAttachmentCollection' does not
satisfy the 'Structure' constraint for type parameter 'T'. I am doing the
following for my collection.
Public Class FileAttachmentCollection
Inherits System.Collections.ObjectModel.Collection(Of FileAttachment)
End Class
Any thoughts on how to correct this error?
Is there an easy way to fix this?