abe545 / CodeOnlyStoredProcedures

A library for easily calling Stored Procedures in .NET using only code (no xml or gui).
MIT License
4 stars 3 forks source link

WithInput sending wrong types for nullables #13

Closed abe545 closed 9 years ago

abe545 commented 9 years ago

If an input class has a Nullable, and the value is null, the StoredProcedure is passing a sql_variant, instead of float. This throws exceptions, in code like the following:

private class Input 
{
    double? Bar { get; set; }
}
StoredProcedure myProc = new StoredProcedure("usp_foo");
myProc.WithInput(new Input()).Execute(); // throws SQL Exception