I have two objects request and response and they have few properties like below
C#
public class Employee
{
public string Name{get;set;}
public Address EmployeeAddress{get;set;}
}Address itself is a class with below properties
C#
public class Address
{
public string Street{get;set;}
public string HouseNo{get;set;}
public List PhoneDetail{get;set;}
}Now Phone is itself a class with below schema
C#
public class phone
{
public string mobile {get;set;}
public string Home{get;set;}
}This above is request object we have a response object having exactly same schema with all classes and properties are same Now I want to map them Like
Request.Name=Response.Name How to do that for all properties specially for Phone which is of type list .

Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Oct 30, 2021, 11:25 PM EDT
You can make use of Automapper
check this link https://www.c-sharpcorner.com/article/mapping-similar-objects-in-asp-net-core-2-0/
Sachin SinghRank #66 · 26.2K reputationPosted Oct 31, 2021, 12:26 AM EDT
Mark TaborRank #914 · 2.3K reputationPosted Oct 31, 2021, 2:23 AM EDT