You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we need to verify that [DbValue] allows the size and type to be conveyed into DbParameter
we should emit a warning to use [DbValue] instead
we should probably treat DbString as a recognized type, and configure things correctly
for this last, I would propose (if any DbString are encountered) writing a helper method into the output (we have some prior art that copies entire files into the output; that would be fine) with a method that takes a DbParameter and DbString (global:: qualified) and does the right things:
if the entire DbString is null, just set Value to DbNull
set the size if appropriate
set the type if appropriate
set the value using AsValue, or a (object)value.Value ?? DbNull if easier
The reason we can't put this into the library is that we can't ref Dapper directly because of the Dapper/Dapper.StrongName duality - hence we need to implement it in codegen
The text was updated successfully, but these errors were encountered:
what does it mean "[DbValue] allows the size and type to be conveyed into DbParameter" (I can see both of them have System.Data.DbType member + DbParameter can handle strings (which DbString are))? Why is DbParameter in the context here?
where is the code that copies entire files into the output?
when passing some member .Foo into the DB, we do that via a parameter; by default we can only guess as to the type and other properties - but sometimes the details matter, so this tribute allows the .Size and .DbType of the parameter object to be controlled more explicitly
DbString
is a Dapper type that allows metadata to be conveyed for string types.However:
DbValue]
Suggestions:
[DbValue]
allows the size and type to be conveyed intoDbParameter
[DbValue]
insteadDbString
as a recognized type, and configure things correctlyDbString
are encountered) writing a helper method into the output (we have some prior art that copies entire files into the output; that would be fine) with a method that takes aDbParameter
andDbString
(global::
qualified) and does the right things:DbString
is null, just setValue
toDbNull
AsValue
, or a(object)value.Value ?? DbNull
if easierThe reason we can't put this into the library is that we can't ref Dapper directly because of the Dapper/Dapper.StrongName duality - hence we need to implement it in codegen
The text was updated successfully, but these errors were encountered: