using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
var list = new List<object> { new ClientTypeA(), new ClientTypeB(), new ClientTypeC() };
var mapped = list.Select(ct => ct switch
ClientTypeA a => Map<ClientTypeA, DtoA>(a) as Dto,
ClientTypeB b => Map<ClientTypeB, DtoB>(b) as Dto,
ClientTypeC c => Map<ClientTypeC, DtoC>(c) as Dto,
_ => throw new Exception(),
foreach (var value in mapped)
Console.WriteLine(value.GetType());
TOut Map<TIn, TOut>(TIn input) where TOut : new() => new();
public Guid Id {get; set;}
public string Name {get; set;}
public Guid Id {get; set;}
public string Name {get; set;}
public Guid Id {get; set;}
public string Name {get; set;}
public int Value {get; set;}
public Guid Id {get; set;}
public string Name {get; set;}
public int Value {get; set;}