Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.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
Vb.net 类别';无法编制索引,因为它没有默认属性_Vb.net - Fatal编程技术网

Vb.net 类别';无法编制索引,因为它没有默认属性

Vb.net 类别';无法编制索引,因为它没有默认属性,vb.net,Vb.net,我收到以下错误类“PropGenie\u WebService.Branch”无法索引,因为它没有默认属性。我不确定原因。我在谷歌上搜索过,但没有得到正确的解释或修正。欢迎光临 branch.vb类中的我的代码: Public Function Update() As Branch Return Update(Me, Path) 'error at update. End Function 在我的基类(Resources.vb)中,我有: 公共共享函数更新(T的{Resources,N

我收到以下错误
类“PropGenie\u WebService.Branch”无法索引,因为它没有默认属性。
我不确定原因。我在谷歌上搜索过,但没有得到正确的解释或修正。欢迎光临

branch.vb类中的我的代码:

Public Function Update() As Branch
    Return Update(Me, Path) 'error at update.
End Function
在我的基类(Resources.vb)中,我有:

公共共享函数更新(T的{Resources,New})(资源为T,路径为字符串)为T
Dim request=CreateRequest(路径&“/{id}”,Method.PATCH)
request.AddUrlSegment(“id”,resource.id.ToString(CultureInfo.InvariantCulture))
request.AddBody(资源)
Dim Client=CreateClient()
Dim responce=客户端执行(共T个)(请求)
如果response.StatusCode HttpStatusCode.OK,则
抛出新的InvalidOperationException(“更新失败”&Convert.ToString(response.StatusCode))
如果结束
返回responce.Data
端函数

您需要指定共享函数所在的类,否则它将尝试在您所在的对象中使用
Update
函数

Public Function Update() As Branch
    Return Resources.Update(Me, Path)
End Function
Public Function Update() As Branch
    Return Resources.Update(Me, Path)
End Function