How can I ignore a property on my model using dapper/dapper extensions/dapper rainbow or any
of those dapper libraries?
Dapper.Contrib has built-in support for marking a column as computed: add ComputedAttribute to allow support for computed columns on Insert. Here's how it works:
class MyModel { public string Property1 { get; set; } [Computed] public int ComputedProperty { get; set; } }
Properties marked with the Computed
attribute will be ignored on inserts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With