由对象构成的 OData

发布于 2024-11-08 21:05:42 字数 914 浏览 0 评论 0原文

假设我有一个名为“Item”和“SubItems”的类,

Public Class SubItem
    Private _SubItemName As String
    Public Property SubItemName() As String
        Get
            Return _SubItemName
        End Get
        Set(ByVal value As String)
            _SubItemName = value
        End Set
    End Property

End Class

<DataServiceKey("Name")> _
Public Class Item
    Private _Name As String
    Public Property Name() As String
        Get
            Return _Name
        End Get
        Set(ByVal value As String)
            _Name = value
        End Set
    End Property
    Private _SubItems As List(Of SubItem)
    Public Property SubItems() As List(Of SubItem)
        Get
            Return _SubItems
        End Get
        Set(ByVal value As List(Of SubItem))
            _SubItems = value
        End Set
    End Property


End Class

我将如何创建一个返回项目列表的服务,并且在查找单个项目时我将能够看到子项目。

Lets say I have a class called "Item" and "SubItems"

Public Class SubItem
    Private _SubItemName As String
    Public Property SubItemName() As String
        Get
            Return _SubItemName
        End Get
        Set(ByVal value As String)
            _SubItemName = value
        End Set
    End Property

End Class

<DataServiceKey("Name")> _
Public Class Item
    Private _Name As String
    Public Property Name() As String
        Get
            Return _Name
        End Get
        Set(ByVal value As String)
            _Name = value
        End Set
    End Property
    Private _SubItems As List(Of SubItem)
    Public Property SubItems() As List(Of SubItem)
        Get
            Return _SubItems
        End Get
        Set(ByVal value As List(Of SubItem))
            _SubItems = value
        End Set
    End Property


End Class

How would I create a service that would return a list of Items and upon looking up an individual item I would be able to see the sub items.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文