Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Exception when mapping an inherited property in a derived object #56

Closed
orenht opened this issue Jul 24, 2017 · 2 comments
Closed

Exception when mapping an inherited property in a derived object #56

orenht opened this issue Jul 24, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@orenht
Copy link

orenht commented Jul 24, 2017

Hi,

I have a type B that inherits from type A, and a Property P defined in A.
When I try to map that property in type B, an exception is thrown at the DommelColumnNameResolver, that the key is not present in the entity maps dictionary.

I suggest that instead of using the DeclaringType for the lookup, use the ReflectedType.

Maybe this issue exists in other places too, I haven't checked.

@henkmollema
Copy link
Owner

That is indeed a known issue. However, ReflectedType is not available in .NET Standard 1.3 (which Dapper.FluentMap and Dommel) targets. A future version might target .NET Standerd 2.0 which allows us to use RefelectedType again.

@henkmollema henkmollema mentioned this issue Aug 22, 2017
3 tasks
@henkmollema henkmollema modified the milestone: v2.0 Aug 22, 2017
@henkmollema henkmollema self-assigned this Aug 25, 2017
@henkmollema henkmollema modified the milestones: v2.0, v1.7.0 Nov 16, 2018
@henkmollema
Copy link
Owner

This have been fixed for applications targeting full .NET (e.g. 4.5 or higher) and .NET Core 2.0 and 2.1 in version 1.7.0: NuGet and release notes.

Dapper.FluentMap.Dommel is updated as well: https://www.nuget.org/packages/Dapper.FluentMap.Dommel/1.6.0.

Please re-open or create a new issue if the problem persists.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants