Closed mgravell closed 9 months ago
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