这是我尝试在 dotnet 中执行 webapi 的代码
Public Function [Get]() As IEnumerable(Of user_data)
Dim db As New databaseusersEntities
Dim avg_users = (From p In db.user_data
Select p.FullName).ToList()
Return db.user_data.ToList()
'Return avg_users.ToList() --- this one doesn't work
End Function
我想避免从 json 数据和全名中获取“实体密钥”,我使用 POCO/DTO 来防止但得到错误
“无法投射‘System.Collections.Generic.List
1[System.String]' to type 'System.Collections.Generic.IEnumerable
1’类型的对象”