Function GetAuthor(entityId As Integer, authorId As Integer, Optional ByVal authorImageWidth As Integer = 250) As String
Function GetAuthor(entityId As Integer, authorId As Integer, feedId As Integer, Optional ByVal authorImageWidth As Integer = 250) As String
I don’t know whats wrong with this. I am getting this error message.
‘Function GetAuthor(entityId As Integer, authorId As Integer, [authorImageWidth As Integer = 250]) As String’ and ‘Function GetAuthor(entityId As Integer, authorId As Integer, feedId As Integer, [authorImageWidth As Integer = 250]) As String’ cannot overload each other because they differ only by optional parameters.
If you call GetAuthor(int, int, int) the compiler will have no clue which of the 2 methods you want since both would be suitable (and that is what this message is telling you)
If you remove the optional part of your second method it will compile since
GetAuthor(int, int)andGetAuthor(int, int, int)can only resolve to your first method andGetAuthor(int, int, int, int)to your second thus making the overload unique by it’s parameters