Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums

Go Back   Vista Forums > Vista technology newsgroups > Indigo

Questions on DataContract

Reply
 
Thread Tools Display Modes
Old 01-21-2008   #1
Peter K
Guest
 
Posts: n/a

Questions on DataContract

Hi - a couple of basic questions:

(1)
if I have a custom class as a parameter to an OperationContract method,
does that class need to be a DataContract class?

(2)
do the DataMembers of a DataContract always have to have a "get" and a
"set"?


Thanks,
Peter
  Reply With Quote

Old 01-21-2008   #2
Just a german hobbyist
eAlex79 is on a distinguished road
 
Join Date: Jan 2008
Vista Ultimate x64
Posts: 2

Location: Germany
Re: Questions on DataContract

Hi!

1) As far as I understand it the classes you expose must be at least serializeable, but the datacontract attribute makes it easy to change the contract later in a compatible way.

Alex
eAlex79 is offline   Reply With Quote
Old 01-22-2008   #3
Cezary Nolewajka
Guest
 
Posts: n/a

Re: Questions on DataContract


1) Custom defined types must have the DataContract attribute. Alternatively,
if you can use MessageContracts.

2) No. They can even be private, protected, or public members but without
having equivalent property declarations.

--
Best regards,
Cezary Nolewajka

Consultant | Microsoft Services | Microsoft | Poland

"Peter K" <xdzgor@xxxxxx> wrote in message
news:u$6yMYCXIHA.4440@xxxxxx
Quote:

> Hi - a couple of basic questions:
>
> (1)
> if I have a custom class as a parameter to an OperationContract method,
> does that class need to be a DataContract class?
>
> (2)
> do the DataMembers of a DataContract always have to have a "get" and a
> "set"?
>
>
> Thanks,
> Peter
  Reply With Quote
 
Reply

Thread Tools
Display Modes









Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Vistax64.com 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48