Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带有泛型接口的.NET继承_.net_Vb.net_Generics_Inheritance_Interface - Fatal编程技术网

带有泛型接口的.NET继承

带有泛型接口的.NET继承,.net,vb.net,generics,inheritance,interface,.net,Vb.net,Generics,Inheritance,Interface,你好,我现在正在玩castle项目ActiveRecord和远程处理设施 我目前的问题是,我需要找到一种方法,在我的address类中实现IBaseRepository中的save sub,但我不知道如何实现 这是我当前的代码,VS在“着装”一行告诉我 我必须为[Shared].IBaseRepository(属于[Shared].IAddress)实现子保存(对象为IAddress) 在线公共覆盖子存储(ByVal obj作为地址)实现IBaseRepository(IadAddress的)。

你好,我现在正在玩castle项目ActiveRecord和远程处理设施

我目前的问题是,我需要找到一种方法,在我的address类中实现IBaseRepository中的save sub,但我不知道如何实现

这是我当前的代码,VS在“着装”一行告诉我 我必须为[Shared].IBaseRepository(属于[Shared].IAddress)实现子保存(对象为IAddress)

在线公共覆盖子存储(ByVal obj作为地址)实现IBaseRepository(IadAddress的)。保存

我无法实现保存,因为在[Shared].IBaseRepository(属于[Shared].IAddress)中没有子保存

我就是不明白:( 请开导我

短暂性脑缺血发作

公共接口IBaseRepository(属于T类)
子保存(ByVal obj As T)
端接口
公共界面设计
继承IBaseRepository(指服装)
属性Guid()作为Guid
属性CompanyName()作为字符串
属性Surename()作为字符串
属性christinName()作为字符串
端接口`
公共类BaseRepository(作为类的T)
继承MarshalByRefObject
实现IBaseRepository(Of T)
作为ActiveRecordMediator的受保护中介程序(属于T)
公共可重写子保存(ByVal obj As T)实现IBaseRepository(Of T)。保存
ActiveRecordMediator(属于T).Save(obj)
端接头
末级
_    
公共课堂演讲
继承BaseRepository(地址的)
服装
Public Overrides Sub Save(ByVal obj As Address)实现IBaseRepository(IadAddress的)。Save
MyBase.Save(obj)
端接头
末级
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
 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