Last post Mar 31, 2010 04:16 PM by jmiadowicz-msft
Mar 30, 2010 12:40 AM|CruzerB|LINK
Public NotInheritable Class TableRecord
Private _customFields As Dictionary(Of String, Object)
Public Sub New()
_customFields = New Dictionary(Of String, Object)
Public Overloads Property Items() As Dictionary(Of String, Object)
Set(ByVal value As Dictionary(Of String, Object))
_customFields = value
''' This function is to load datareader object into tablerecord object.
''' <param name="reader"></param>
Public Sub Load(ByVal reader As IDataReader)
Dim field As Integer
field = .FieldCount
For i = 0 To field - 1
If Not .IsDBNull(i) Then
_customFields(.GetName(i)) = .GetValue(i)
_customFields(.GetName(i)) = Nothing
field = Nothing
This is my data contract class. how to let my "TableRecord" data contract class to hv the same attribute behavior ("TableRecordTypeDescriptionProvider") after travel from WCF?
Mar 31, 2010 04:16 PM|jmiadowicz-msft|LINK
I will assume that you're trying to do something like this. You have a WCF service that returns (perhaps among other things) instances of type TableRecord. You also have a client for this service, which you generate using Visual Studio's Add Service Reference
or svcutil.exe. Your generate client-side code now contains the class TableRecord, but the class doesn't have the attribute you defined.
The simplest thing to do is to define this class in a library that is shared between client and service. Then, when you use Add Service Reference, you can specify that types from that library should be reused (rather than generated). You now have the same
class (with all attributes) on both client and service.