public readonly属性计数为整数'没有参数,并且无法索引其返回类型 [英] public readonly property count as integer' has no parameters and its return type cannot be indexed
本文介绍了public readonly属性计数为整数'没有参数,并且无法索引其返回类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好!我有下面的代码,我得到错误:public readonly属性计数为整数'没有参数,其返回类型无法索引。不知道伯爵有什么问题。任何帮助都将非常感谢,谢谢。
Hi all out there! I have this code below and I get the error: public readonly property count as integer' has no parameters and its return type cannot be indexed. Don't know what's wrong with the Count. Any help will be much appreciate, thanks.
Public Sub Connect(userName As String)
Dim id = Context.ConnectionId
If ConnectedUsers.Count(Function(x) x.ConnectionId = id) = 0 Then
ConnectedUsers.Add(New UserDetail() With { _
.ConnectionId = id, _
.UserName = userName _
})
' send to caller
Clients.Caller.onConnected(id, userName, ConnectedUsers, CurrentMessage)
' send to all except caller client
Clients.AllExcept(id).onNewUserConnected(id, userName)
End If
End Sub
推荐答案
你想说的可能是:
Probably, what you want to say is:
If ConnectedUsers.Where(Function(x) x.ConnectionId = id).Count = 0 Then
这篇关于public readonly属性计数为整数'没有参数,并且无法索引其返回类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文