West Wind Toolkit for .NET
Ambiguous Reference Error
Gravatar is a globally recognized avatar based on your email address. Ambiguous Reference Error
  Craig Tucker
  All
  Feb 17, 2021 @ 08:28am

Hi Rick, I wanted to try the Find command without having to write inline sql or a stored procedure by just passing the value, table name, and field.
However, I am getting an ambiguous reference error for which I can't fix.

I have it working with a stored procedure, but as mentioned would be cool without it.

var ut = sql.Db.Find<Unit_TBL>("QueueMessageManager.dbo.GetUnitByID @0", tp.UnitID);

Any suggestions? Thanks, Craig

Gravatar is a globally recognized avatar based on your email address. re: Ambiguous Reference Error
  Rick Strahl
  Craig Tucker
  Feb 17, 2021 @ 01:29pm

That's a bug...

Can you try explicitly naming the parameters?

Both of these work:

var customer = data.Find<Customer>(keyValue: 1, tableName: "Customers",keyField: "Id" );
customer = data.Find<Customer>(keyValue: "Strahl", tableName: "Customers",keyField: "LastName" );

+++ Rick ---

© 1996-2021