None of my extension methods appear in code

I have a number of extension methods defined in my current project. This is a VB.NET project. I have no problem using these methods inside the files located in the App_Code directory, this is the same place where I defined the methods. However, in my page.aspx.vb file, these methods are not displayed behind the page. I tried to include the correct namespace, no luck.

Does anyone have an idea why I cannot call the extension method in the code behind the file?

Defined in the App_Code folder

<Extension()> _
Public Function GetSelected(ByVal apps As List(Of Appointment)) As Appointment
    Dim selected = From a In apps _
                   Where a.Selected = True

    Return selected.Single
End Function

Defined in the App_Code folder inside another class (this one works fine)

Public ReadOnly Property Selected() As Appointment
    Get
        Return _appointments.GetSelected()
    End Get
End Property

Defined in the "Root application" folder inside the code behind the file (does not work)

Public ReadOnly Property Selected() As Appointment
    Get
        Return _appointments.GetSelected()
    End Get
End Property

, . , , . "GetSelected" "System.Collections.Generic.List(of Appointment)"

+3
4

, Public.

+10

"" - , . , - . VB9?

, , .

, , , App_Code ASP.NET, ASP.NET mojo . , -, , :)

EDIT: , - VB9 ( - LINQ, ), App_Code. Visual Studio? ? - .

+1

, ? , , . .

0

VS?

0

Source: https://habr.com/ru/post/1704605/


All Articles