Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Dapper multi mapping not recognizing parameter value

When i run my Web API i get the following error message "Must declare command parameters". The problem is i don't understand what i did in the param: new { p } section if that isn't the parameters.Also i haven't used Dapper for a quite some time so i am used to pure ADO.NET.Also i don't think it should be a problem that it's Fire Bird database since database that i use is pretty old. Thanks in advance for any answer.

I forgot to mention , when i hard code my params i get another exception ,"When using the multi-mapping APIs ensure you set the splitOn param if you have keys other than Id".

    var p = new DynamicParameters();
    p.Add("@name",name);
    using(IDbConnection _context = new FbConnection(connectionString))
    {
        var result = _context.Query<Character , PicturePath , Character>(sql,(character , picturePath)=>
            {
                character.PicturePath = picturePath.PicturePath;
                return character;
            },splitOn:"Id";param: new { p });

         characterOutput = (Character)result;
    }

Comments