What's an easy way to cast one object to another when they have the same properties? For example:
public class Test1
{
public string FirstName{ get; set; }
public string LastName{ get; set; }
}
public class Test2
{
public string FirstName{ get; set; }
public string LastName{ get; set; }
}
So if I have a populated Test1 object and I want all of its values to be populated into Test2, then what's the easiest way to do that? I know I can set values 1-by-1 from Test1 to Test2 but I was wondering if you could recommend a quicker, easier way? Like test1.Map(test2) or something like that?