Hi, I have a function that populates a list with items of type 'RemoteCustomFieldValue'. Now I would like to extend this function in a way that the list would accept items of different type 'RemoteFieldValue'. I thought this would work like in the snippet but I get the following error in the if-statement: 'The expression of type "System.Collections.Generic.List(Of T)" can never be of type "System.Collections.Generic.List(Of legion.SST.Jira.RemoteCustomFieldValue)".' And another one when adding the item to the list 'The value of type "legion.SST.Jira.RemoteFieldValue" can not be converted to "T"' How can I solve this problem? Perhaps is there another way to do it. Many thanks in advance
Private Sub GetUserInputValues(Of T)(ByRef alRemoteCustomFieldValue As List(Of T))
....
**If TypeOf alRemoteCustomFieldValue Is List(Of RemoteCustomFieldValue) Then **
Dim rcfvUsrInput As RemoteCustomFieldValue = New RemoteCustomFieldValue
rcfvUsrInput.customfieldId = ContentCtrl.ID
rcfvUsrInput.values = s.ToArray
alRemoteCustomFieldValue.Add(rcfvUsrInput)
Else
Dim rcfvUsrInput As RemoteFieldValue = New RemoteFieldValue
rcfvUsrInput.id = ContentCtrl.ID
rcfvUsrInput.values = s.ToArray
**alRemoteCustomFieldValue.Add(rcfvUsrInput)**
End If
End If
End Sub