tags:

views:

33

answers:

2

I have the following code in a model

base.Name = instance.Name;
base.SSN = instance.SSN;
base.DateModified = DateTime.Now
base.ClienType = instance.ClientType;

If I add more properties to my base then i have to update my model to update the properties. Is there an easier way to update the base.properties instead of listing each of them and then updating the same? Yes i know i am being lazy

+1  A: 

You could use Automapper to automatically map where there is a naming convention.

Also beware that things the following would not map as one has one less t

base.ClienType = instance.ClientType;
dove
+3  A: 

I'm not quite sure why you are doing this, but you might want to take a look at AutoMapper - if your properties are the same on both side you can get it to automatically map one to the other without doing any real setup.

Steven Robbins