excel-mapper icon indicating copy to clipboard operation
excel-mapper copied to clipboard

Map custom types

Open Tr0sT opened this issue 1 year ago • 0 comments


public record Id(int Value);

public class Data
{
    public Id Id { get; private set; }
}

Why is it forbidden to register non-primitive types?

Map(data => data.Id)
            .WithConverter(v => new Id(int.Parse(v)))
            .WithColumnName("Id");

Tr0sT avatar Jan 13 '24 10:01 Tr0sT