There is no need to talk about that. Read the code and use it. Code explains all you need to know.

 

--------------------------------------------------------------------------------------------

 

 public static class Entity

    {

        public static object Copy(object source, object destination)

        {

            System.Reflection.PropertyInfo[] sourceProps = source.GetType().GetProperties();

            System.Reflection.PropertyInfo[] destinationProps = destination.GetType().GetProperties();

            foreach (System.Reflection.PropertyInfo sourceProp in sourceProps)

            {

                ColumnAttribute column = Attribute.GetCustomAttribute(sourceProp, typeof(ColumnAttribute)) as ColumnAttribute;

                if (column != null && !column.IsPrimaryKey)

                {

                    foreach (System.Reflection.PropertyInfo destinationProp in destinationProps)

                    {

                        if (sourceProp.Name == destinationProp.Name && destinationProp.CanWrite)

                        {

                            destinationProp.SetValue(destination, sourceProp.GetValue(source, null), null);

                            break;

                        }

                    }

                }

            }

            return destination;

        }

    }

--------------------------------------------------------------------------------------------

 

 

and you can use it like this;

--------------------------------------------------------------------------------------------

Campaign newCampaign = (Campaign)Entity.Copy(campaign, new Campaign());

--------------------------------------------------------------------------------------------

 

hope this helps