Re: Framework 3.5 Copy POCO?
"David L. Penton" <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <[email protected]> |
The class itself would and any other classes internally that need to be included in the serialization.
Richard Blewett wrote:
> The class would have to be marked as serializable wouldn't it?
>
> Rich
>
>> -----Original Message-----
>> From: Frans Bouma
>>
>>> If you have SP1 you could use WCF's DataContractSerializer (won't
>>> work prior to SP1 though)
>>
>> Can't you just use the BinaryFormatter and a MemoryStream?
>>
>> FB
>>
>>> Rich
>>>
>>>> -----Original Message-----
>>>> From: SteveC
>>>>
>>>> With .NET Framework 3.5, what is the best/fastest/slickest way to
>>>> make a
>>>> (non-reference) copy of the object of a Plain Old C Sharp Object?
>>>>
>>>> //My Sample
>>>> public class MyClass
>>>> {
>>>> private string _mystring;
>>>>
>>>> public string MyString
>>>> {
>>>> get { return _mystring; }
>>>> set { _mystring = value; }
>>>> }
>>>>
>>>> public int IntWithNoPriv { get; set; }
>>>> }
>>>>
>>>> Thanks.
===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives