c# - Query with JOIN clause always returns a empty result set using Dapper -


i trying following query using dapper returning empty result set. first tried remove where clause in order isolate problem didn't work. after added alias c.name column in select clause didn't work either.

private const string selectclaims =  @"select c.name claims c    inner join users_claims uc on c.id = uc.id_claim    uc.id_user = @id";  using (var conn = new fbconnection(connectionstring)) {     var claims = conn.query<string>(selectclaims, new { user.id });     return claims; } 

if replace query above right here works fine:

select name claims 

to honest not sure if using dapper since selecting named column , mapping simple string - believe dapper doesn't see 'name' property fails silently. guess should try either query<t> typed object or use query<dynamic> avoid unnecessary class creation.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -