I have three entity.
public class Book
{
public string Name {get;set;}
}
public class Author
{
public string AuthorName {get;set;}
}
public class BookDTO
{
public string Name {get;set;}
public string AuthorName {get;set;}
}
how to map Book and Author to BookDTO ?
and how to map BookDTO to Book and Author?
I used the automapper in my solution.
You could create a mapping for each:
And then use it like this: