Answer Posted / rad
public static T DeepCopy<T>(T obj)
{
object result = null;
using (var ms = new MemoryStream())
{
var formatter = new BinaryFormatter();
formatter.Serialize(ms, obj);
ms.Position = 0;
result = (T)formatter.Deserialize(ms);
ms.Close();
}
return (T)result;
}
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
What is sta?
What is the file extension of web service?
What is a session http?
What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
What is Pre-Render event in ASP.NET?
What is Web Server Control Templates.?
What is viewstate? What does the “enableviewstate” property do?
Is asp.net and .net same?
What is the mvc model?
Let's say I have an existing application written using vb6 and this application utilizes windows 2000 com+ transaction services. How would you approach migrating this application to.net?
What’s difference between “optimistic” and “pessimistic” locking?
What are validator? How do you disable them?
How many web config files can be created for an application?
Explain the page lifecycle of an asp.net mvc? : asp.net mvc
Which is the parent class of the ASP.NET server control?