c# - Cant find any way to group by multi dapper result -
i have query:
const string query = @" select * [users] u left join [userroles] ur on [ur].[userid] = [u].[userid] left join [roles] r on [r].[roleid] = [ur].[roleid] left join [externallogins] el on [el].[userid] = [u].[userid]; ";
and next class structure:
public sealed class user : iuser<string> { public string id { { return this.userid.tostring(); } } public guid userid { get; set; } public string passwordhash { get; set; } public string securitystamp { get; set; } public string username { get; set; } public iqueryable<userlogininfo> userlogininfos; public iqueryable<role> roles; }
and want ienumerable<user>
dapper using single sql query (this @ start).
var rows = connection.query(query).toarray(); if (rows.length == 0) { return null; } var users = ... return users;
is there example?
Comments
Post a Comment