Clone

Clone

Old forum URL: forums.lhotka.net/forums/t/10364.aspx


kriya posted on Thursday, May 12, 2011

 

How can I get the clone  of  _myClassObject in _myClass ?

Look this wotz the solution

public static class MyClassConvert

  {

    public static BusinessBase Convert(BusinessBase _myClassObject)

    {

      BusinessBase _myClass = _myClassObject.Clone();

Quick Reply plzzzzzzzzzzzzzzzzzzzzz

 

RockfordLhotka replied on Thursday, May 12, 2011

Use the ICloneable interface instead of BusinessBase as your type.

ICloneable original = (ICloneable)_myClassObject;
object copy = original.Clone();

 

Copyright (c) Marimer LLC