Example #1
0
        public void Adapt(ToDo from, ToDoViewModel to)
        {
            foreach (var toProp in to.GetType().GetProperties())
            {
                var fromProp = from.GetType().GetProperty(toProp.Name);

                if (fromProp != null)
                {
                    toProp.SetValue(to, fromProp.GetValue(from));
                }
            }
        }