c# - Dapper function doesn't map the string values from stored procedure, but maps the other values correctly -


i have stored procedure returns data in following format:

"companyid"|"metadataid"|"mnemonic"|"short"|"format"|"metadatatype"|"lngvalue"|"decvalue"|"charvalue"|"datevalue"|"blnvalue"|"sorder"|"version"|"type"|"sortorder"|"createddate" 

the strings mnenomic , short. sp returns multiple rows why thinking using ienumerable<myclass> best way map rows.

my class mapping data:

public class creditdatareport     {         public int companyid { get; set; }         public int metadataid { get; set; }         public string mnenomic { get; set; }         public string shortdesc { get; set; }         public int format { get; set; }         public int metadatatype { get; set; }         public int lngvalue { get; set; }         public double decvalue { get; set; }         public string charvalue { get; set; }         public datetime datevalue { get; set; }         public int? blnvalue { get; set; }         public int sorder { get; set; }         public int version { get; set; }         public int type { get; set; }         public int sortorder { get; set; }         public datetime createddate { get; set; }     } 

and method calling sp , mapping data:

public ienumerable<creditdatareport> getcreditrecommendation(int reportid)         {             dynamic result = connection.query<creditdatareport>("cor_creditratiodataxxgetbyreportid", new { reportid = reportid },                 transaction: this.transaction, commandtype: commandtype.storedprocedure);              return result;         } 

my problem when call function var testing = getcreditrecommendation(2).tolist(); , walk through code @ runtime see data correctly mapped corresponding value in creditreportdataclass except 2 string values mnenomicand short.

what missing in code , using dapper in wrong way?

mnemonic != mnenomic (look very carefully)

short != shortdesc


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -