Re: Framework 3.5 Copy POCO?
Frans Bouma <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <009501c93e86$f8f18f50$ead4adf0$@nl> |
> The class would have to be marked as serializable wouldn't it? *slaps forehead* Of course! FB > > Rich > > > -----Original Message----- > > From: Discussion of advanced .NET topics. [mailto:ADVANCED- > > [email protected]] On Behalf Of Frans Bouma > > Sent: 04 November 2008 12:43 > > To: [email protected] > > Subject: Re: [ADVANCED-DOTNET] Framework 3.5 Copy POCO? > > > > > 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: Discussion of advanced .NET topics. [mailto:ADVANCED- > > > > [email protected]] On Behalf Of SteveC > > > > Sent: 04 November 2008 12:05 > > > > To: [email protected] > > > > Subject: [ADVANCED-DOTNET] Framework 3.5 Copy POCO? > > > > > > > > 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 > > > > > > =================================== > > > View archives and manage your subscription(s) at > > > http://peach.ease.lsoft.com/archives > > > > =================================== > > View archives and manage your subscription(s) at > > http://peach.ease.lsoft.com/archives > > =================================== > View archives and manage your subscription(s) at > http://peach.ease.lsoft.com/archives =================================== View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives