score:1

Accepted answer

If you are creating the objects at that time, using object initalizers is probably the cleanest coded solution.

var model = new myMvcModel()
{
    FirstName = input.FirstName,
    LastName = input.LastName,
    City = input.City
}

Otherwise using reflection or AutoMapper as Ek0nomik suggest are your only solutions that I could suggest.

Like Ek0nomik I prefer to do it manually rather than AutoMapper. Even created a VS macro to inspect both objects and output some scaffolding.


Related Query