Ormlite functionality breaks SQLServer TableValuedParams in 5.70

Hi - I use table value params in SQL Server which have worked to do bulk select and inserts etc, up until recently. They were working in ormlite 5.51 and 5.60 (see working repro here)

However, after I update to latest 5.70 nuget packages, these fail with the error: “System.ArgumentException: ‘The table type parameter ‘BulkInCollection’ must have a valid type name.’” (where BulkInCollection is the param name I use in my dynamic query, see repro of broken instance here)

Only change between the two code bases is an update of the Servicestack nuget packages.

Any idea what recent Ormlite changes might be causing this? Thanks.

You’re using OrmLite’s embedded version of Dapper here, not OrmLite:

return db.Query<TTable>(sql, dbArrayParams).ToList();
```

I’ve upgraded to the latest version of Dapper in this commit which is now available from v5.7.1 on MyGet.

If it’s still an issue you’ll need to submit an issue with Dapper, but to request support you should switch to using their official NuGet package instead of using OrmLite’s embedded version (which is literally just an interned version of Dapper with namespace replaced with s/Dapper/ServiceStack.OrmLite.Dapper).

Hey, thanks as always for the very fast turnaround. Same issue occurs under the new version, some googling shows that Dapper library may have been updated recently, (I found https://github.com/StackExchange/Dapper/blob/master/Dapper.Tests/ParameterTests.cs) ,the line

  ex.Message.Equals("The table type parameter 'ids' must have a valid type name.");

on line 430 looks a bit like my error message, so I will have to do some analysis of what the Dapper boys have been up to and see what I can find.

Thanks again

For anyone else who finds themselves here - a quick look at Dapper commit history suggests they have been reverting / restoring some functionality that was part of dotnetframework, (or something), though strangely, noone has commented that their TVP is busted yet.

Anyway, I followed the advice found here to make some new TVP parameter classes that once again work in dotnetcore, hope it helps.

1 Like