henkmollema / Dapper-FluentMap

Provides a simple API to fluently map POCO properties to database columns when using Dapper.
MIT License
429 stars 88 forks source link

KeyNotFound exception in Dommel resolvers #25

Closed henkmollema closed 9 years ago

henkmollema commented 9 years ago

Accessing an entity map for a type which has not entity map results in a KeyNotFound exception due to the fact that an indexer is used without a ContainsKey check:

var mapping = FluentMapper.EntityMaps[type] as IDommelEntityMap;

TryGetValue should be used here.

henkmollema commented 9 years ago

Fixed with 7ea72fca1ad1a3f5b8dbecbd8572dd9d4449eee1.