Skip to content

Problem with cache when mapping to primitive typed collection #33

@rstraszewski

Description

@rstraszewski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions