tattocau / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
1 stars 1 forks source link

dynamic MultiMapping since DapperTable #131

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Since the introduction of DapperTable (over FastExpando), multi-mapping to 
dynamic objects populates the dynamic object with all values regardless of 
splitOn property.

For example:

var results = cn.Query<dynamic, int, dynamic>(
    "SELECT 1 Id, 'Mr' Title, 'John' Surname, 4 AddressCount",
    (person, addressCount) =>
    {
        return person;
    },
    splitOn: "AddressCount"
).FirstOrDefault();

With the latest DapperTable source, 'person' is a dynamic object looking like: 
{ Id = 1, Title = 'Mr', Surname = 'John', AddressCount = 4 }.
'addressCount' is still correct and is an int with the value 4.

However, the latest NuGet package which looks to contain the previous 
FastExpando code, correctly assigns 'person' as: { Id = 1, Title = 'Mr', 
Surname = 'John' }.

Original issue reported on code.google.com by mal.earn...@btinternet.com on 24 Feb 2013 at 11:55

GoogleCodeExporter commented 8 years ago
Verified; will look at this week (and a few others)

Original comment by marc.gravell on 25 Feb 2013 at 7:26