-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Description
At the moment, you have to write something like :
var sql = @"select * from #Posts p
left join #Users u on u.Id = p.OwnerId
Order by p.Id";
var data = connection.Query<Post, User, Post>(sql, (post, user) => { post.Owner = user; return post;});
var post = data.First();Would it be possible to support something like :
var sql = @"select p.id, p.title, p.content, u.Id as owner__id, u.Name as owner__Name
from Posts p
left join Users u on u.Id = p.OwnerId
Order by p.Id";
var data = connection.Query<Post>(sql);
var post = data.First();As you can see double underscore would be understood as "nested object" and I do not have to specify the "strange" function.