Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.83 KB | None | 0 0
  1. ' NOTE: If you change the interface name "IService1" here, you must also update the reference to "IService1" in App.config.
  2. <ServiceContract()> _
  3. Public Interface IInventoryService
  4.  
  5.   <OperationContract()> _
  6.   Function GetInStock(ByVal productId As Integer) As Short
  7.  
  8.   <OperationContract()> _
  9.   Function GetProduct(ByVal productId As Integer) As Product
  10.  
  11.   <OperationContract()> _
  12.   Function UpdateProduct(ByVal _product As Product) As Boolean
  13.  
  14. End Interface
  15.  
  16. ' Use a data contract as illustrated in the sample below to add composite types to service operations
  17. <DataContract()> _
  18. Public Class Product
  19.  
  20.   Private productIdValue As Integer
  21.   <DataMember()> _
  22.   Public Property ProductId() As Integer
  23.     Get
  24.       Return productIdValue
  25.     End Get
  26.     Set(ByVal value As Integer)
  27.       productIdValue = value
  28.     End Set
  29.   End Property
  30.  
  31.   Private productNameValue As String
  32.   <DataMember()> _
  33.   Public Property ProductName() As String
  34.     Get
  35.       Return productNameValue
  36.     End Get
  37.     Set(ByVal value As String)
  38.       productNameValue = value
  39.     End Set
  40.   End Property
  41.  
  42.   Private unitPriceValue As Decimal
  43.   <DataMember()> _
  44.   Public Property UnitPrice() As Decimal
  45.     Get
  46.       Return unitPriceValue
  47.     End Get
  48.     Set(ByVal value As Decimal)
  49.       unitPriceValue = value
  50.     End Set
  51.   End Property
  52.  
  53.   Private unitsInStockValue As Short
  54.   <DataMember()> _
  55.   Public Property UnitsInStock() As Short
  56.     Get
  57.       Return unitsInStockValue
  58.     End Get
  59.     Set(ByVal value As Short)
  60.       unitsInStockValue = value
  61.     End Set
  62.   End Property
  63.  
  64.   Private unitsOnOrderValue As Short
  65.   <DataMember()> _
  66.   Public Property UnitsOnOrder() As Short
  67.     Get
  68.       Return unitsOnOrderValue
  69.     End Get
  70.     Set(ByVal value As Short)
  71.       unitsOnOrderValue = value
  72.     End Set
  73.   End Property
  74.  
  75. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement