I have two classes
public class foo1
{
public int id;
public string image_link;
public string sale_price;
}
and
public class foo2
{
public int Id;
public string ImageLink;
public string SalePrice
}
The property values differ only by underscore and cases. I need to map these two classes.
For now I am trying something like this and its working:
//var b = object of foo2
var a = new foo1{
a.id = b.Id,
a.image_link = b.ImageLink,
a.sale_price = b.SalePrice
}
I heard of AutoMapper, but I din't have clear idea of how i am going to use that or where is the option of ignoring cases or underscores in it. or is there any better solution to it?