using System.Collections.Generic;
using Faithlife.Reflection;
var dictionary = ConvertDtoToDictionary(new { one = 1, two = "II" });
foreach (var pair in dictionary)
static IReadOnlyDictionary<string, object> ConvertDtoToDictionary(object dto) =>
DtoInfo.GetInfo(dto.GetType()).Properties.ToDictionary(x => x.Name, x => x.GetValue(dto));