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
Currently we support names (parameter and column) via [DbValue], however there is also a well-known [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute] that is commonly used.
I'm hesitant to use this blindly, because that would change existing behavior, so this should be triggered via a new UseColumnAttributeAttribute (yes, the naming is weird - see also XmlAttributeAttribute) which would apply at all levels (like most DapperAOT attributes):
feature should only apply if [UseColumnAttribute] or [UseColumnAttribute(true)] is in play
[UseColumnAttribute(false)] explicitly disables
onlyName would be used; we aren't interested in Order etc
if we see a [Column(...)] with a Name but don't see any explicit on/off flag, emit a warning so the user knows to opt in/out
works similar to [DbValue] with Name, but: doesn't impact parameters
See ElementMember.DbName; IMO to avoid confusion, if there is both an enabled [Column(...)] and a [DbValue(...)] providing a different name (we can ignore if they match), we should issue a warning but take the DbValue(...) version, i.e.
A column name is specified via both [DbValue] and [Column]; "Whatever" will be used
Currently we support names (parameter and column) via
[DbValue]
, however there is also a well-known[System.ComponentModel.DataAnnotations.Schema.ColumnAttribute]
that is commonly used.I'm hesitant to use this blindly, because that would change existing behavior, so this should be triggered via a new
UseColumnAttributeAttribute
(yes, the naming is weird - see alsoXmlAttributeAttribute
) which would apply at all levels (like most DapperAOT attributes):[UseColumnAttribute]
or[UseColumnAttribute(true)]
is in play[UseColumnAttribute(false)]
explicitly disablesName
would be used; we aren't interested inOrder
etc[Column(...)]
with aName
but don't see any explicit on/off flag, emit a warning so the user knows to opt in/out[DbValue]
withName
, but: doesn't impact parametersSee also https://stackoverflow.com/questions/77073286/can-dapper-mappings-be-automated-with-attributes
The text was updated successfully, but these errors were encountered: