AutoMapper: It is not possible to configure a mapping between an open generic type and a nongeneric or closed generic type

The problem preventing open generic to nongeneric mappings (e.g. Id<> to int) and vice versa: TypePair.GetOpenGenericTypePair returns null unless both types are open generic types. Its only usage is in MapperConfiguration.FindClosedGenericTypeMapFor. Repro for this problem. I think I found a solution to this problem.

To enable mapping an open generic to closed generic (e.g. Id<> to Value<int>) and vice versa, another lookup may be required.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 32 (23 by maintainers)

Most upvoted comments

And the last part is that it needs to be on NuGet as a non-pre-release package. There’s a deal with NuGet packages that if your package depends on a pre-release, then you have to mark as pre-release.

To be toooooootally transparent here, I’m waiting for .NET Core RC2 - not ASP.NET Core RC2. ASP.NET RC2 does not have a date yet (https://github.com/aspnet/Mvc/milestones). Yes this confused me too.

The reason why I’m waiting is for the new netstandard TFN to be available in VS and all the other tools.