Question

Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility.

my current problem is that i need the find a way the implement the save sub from IBaseRepository in my address class and i dont know how.

here is my current code, VS tells me on the line "implements IAddress" that i have to implement Sub Save(obj As IAddress) for [Shared].IBaseRepository(Of [Shared].IAddress)

and on line Public Overrides Sub Save(ByVal obj As Address) Implements IBaseRepository(Of IAddress).Save

that i cant implement Save cause there is no Sub Save in [Shared].IBaseRepository(Of [Shared].IAddress)

i just dont get it :( please enlighten me.

tia

Public Interface IBaseRepository(Of T As Class)  
     Sub Save(ByVal obj As T)  
End Interface

Public Interface IAddress  
    Inherits IBaseRepository(Of IAddress)  
    Property Guid() As Guid  
    Property CompanyName() As String  
    Property Surename() As String  
    Property Christianname() As String  
End Interface`

Public Class BaseRepository(Of T As Class)  
Inherits MarshalByRefObject   
Implements IBaseRepository(Of T)

    Protected mediator As ActiveRecordMediator(Of T)  

    Public Overridable Sub Save(ByVal obj As T) Implements IBaseRepository(Of T).Save  
        ActiveRecordMediator(Of T).Save(obj)  
    End Sub  
End Class


<ActiveRecord("Address")> _    
Public Class Address  
    Inherits BaseRepository(Of Address)  
    Implements IAddress

    Public Overrides Sub Save(ByVal obj As Address) Implements IBaseRepository(Of IAddress).Save
        MyBase.Save(obj)
    End Sub
End Class
Was it helpful?

Solution

 Public Class Address
    Inherits BaseRepository(Of Address)
    Implements IAddress


    Public Overrides Sub Save(ByVal obj As Address)
        MyBase.Save(obj)
    End Sub


    Public Overloads Sub Save(ByVal obj As IAddress) _
         Implements IBaseRepository(Of IAddress).Save
    End Sub
 '
 ' Some other stuff...
 '
 End Class
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top