dto and automapper

C#
public TeamDTO GetByID(int id)
{
    var team = ... //Get Team entity from data store
    return Mapper.Map<TeamDTO>(team);
}

Source

Also in C#: