Skip to content

Instantly share code, notes, and snippets.

@david-driscoll
Created January 13, 2022 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-driscoll/a260cb9d670aeecc3327074cd9f1241d to your computer and use it in GitHub Desktop.
Save david-driscoll/a260cb9d670aeecc3327074cd9f1241d to your computer and use it in GitHub Desktop.
void Main()
{
var config = new MapperConfiguration(expression =>
{
expression.CreateMap<C, C>().ReverseMap(); // works
expression.CreateMap<D, D>(); // stackoverflows
});
var mapper = config.CreateMapper();
}
private class C
{
public string A { get; set; }
}
private class D
{
public E? Bar { get; set; }
}
private class E : IEnumerable<E>
{
public IEnumerator<E> GetEnumerator()
{
throw new NotImplementedException();
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment