You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem with cache when mapping to primitive typed collection #33
When using mapping to primitive typed collection convention SELECT Id, BankAccountNumber AS BankAccountNumbers_$ FROM Account
And then mappping results from database more than one time: var queryResult = dbConnection.Query<dynamic>(Query, new { Id= id }); var result1 = Slapper.AutoMapper.MapDynamic<ContractorDto>(queryResult).First(); var result2 = Slapper.AutoMapper.MapDynamic<ContractorDto>(queryResult).First(); var result3 = Slapper.AutoMapper.MapDynamic<ContractorDto>(queryResult).First();
Every result has bigger number of bank accounts, result1 two, result2 four and result3 six.
Only after clearing cache the results are good.
So i guess there is some problem with caching and primitive typed collections.
changed the title [-]Problem with chace when mapping to primitive typed collection[/-][+]Problem with cache when mapping to primitive typed collection[/+]on May 23, 2016
Activity
[-]Problem with chace when mapping to primitive typed collection[/-][+]Problem with cache when mapping to primitive typed collection[/+]geirsagberg commentedon May 26, 2016
You can do
MapDynamic<T>(queryResult, keepCache: false)to clear cache between calls.