I have a service I have an existing class of merchandise items, what would I want to know about how I used to do WCF Can I pass a class from the Business Object Assembly, while my WCF can create a new class while adding or tagging the site?
Here is an existing UDT: Namespace example: Application.BusinessObjects.Appointments
Public structure appointment resources Type in the form of a personal _ID as the form of the private _name string as the resource type ID () as the string returns _id and set (ByVal value as String) _id = value End Set End Property Property Type () Get ResourceTypeOption Return in CTYPE (_type, Int32) Set End (ByVal Value as ResourceTypeOption) _typ E = value End Set End Get String Return As Asset Property Name () Set the _name end (ByVal value as string) _name = value End Set End Property Public Sub New (The same ID as the string, the reverse type As an option, string in the form of a whit name) _id = id = type = type _name = name and end sub structure There is only one I created with data contract attributes : Namespace example: Application.Serv Ice.Appointments
& lt; DataContract () & gt; _ Public structure as private resources, as the resource type Private _name string as the Private Type type & lt; DataMember () & gt; _Get string return as property id () _id and set (by value as string) _id = value & set end and property & lt; DataMember () & gt; Return to ResourceTypeOption as Property Type () Set CType (_type, Int32) end (ResourceTypeOption as ByVal Value) _type = value End Set End Property & lt; DataMember () & gt; _ Get the string as the asset name () Set the _name end (By value value as the string) _name = value and set end and property public SubNew (ByVal id string, ResourceTypeOption as ByVal type, ByVal name as string) _id = id _type = type _name = name ending sub-end structure
There is an easy way to share the type between the client and the service, by adding the service reference By adding your customer to the context of the shared type assembly.
You can find detailed scenarios and sample projects there:
Comments
Post a Comment