Suppose I have two classes:
public class Student { public int Id {get; set;} public string Name {get; set;} public IList Courses{ g
Write a implicit operator in anyone class
public static implicit operator StudentDTO(Student student) { //use skeet's library return PropertyCopy.CopyFrom(student); }
now you can do that
StudentDTO studentDTO = student;