using AgileObjects.ReadableExpressions;
using AutoMapper.Configuration.Annotations;
using System.Collections.Generic;
public static class ArrExtensions
public static string Readable(this IEnumerable<int> intList)
foreach (var elem in intList)
result += sep + $"{elem}";
public static void Main()
Console.WriteLine($"Difference = {diff.Readable()}");
var configuration = new MapperConfiguration(cfg =>
cfg.CreateMap<Game, GameDto>()
src => src.GameGenres.Select(relation => relation.GenreId))
var executionPlan = configuration.BuildExecutionPlan(typeof(Game), typeof(GameDto));
var description = executionPlan.ToReadableString();
var mapper = configuration.CreateMapper();
Title = "Hitman Absolution",
ReleaseDate = new DateOnly(2012, 08, 12)
ReleaseDate = new DateOnly(2012, 08, 12)
var gameDtos = mapper.Map<Game[],IEnumerable<GameDto>>(games);
Console.WriteLine(description);
foreach (var gameDto in gameDtos)
Console.WriteLine($"[ Title = {gameDto.Title}, Id = {gameDto.Id}, Price = {gameDto.Price}, ReleaseDate = {gameDto.ReleaseDate}, Genres = {gameDto.Genres.Readable()} ]");
public DateOnly ReleaseDate;
public IEnumerable<GameGenre> GameGenres;
public IEnumerable<int> Genres;
public DateOnly ReleaseDate;