Dapper-FluentMap icon indicating copy to clipboard operation
Dapper-FluentMap copied to clipboard

How can I make the database to use the default value I set,How to map.

Open babbitt9 opened this issue 3 years ago • 1 comments

My program use Sqlite 3 and I set a datetime field with the defalut value of datetime('now', 'localtime').

  1. When I map the field with the Ignore method, it's ok to insert a new record ,the field is filled a correct datetime value(my server time).But when I get the record(by ExecuteReader) from database ,someting is wrong (System.NotImplementedException) because the field is ignored.
  2. I try to map the field with SetGeneratedOption(DatabaseGeneratedOption.Identity) or .SetGeneratedOption(DatabaseGeneratedOption.Computed) ,the field is filled with '0001-01-01 00:00:00'

Is there a way to do that I can get the correct datetime value and I can query the record without exception? Thanks!

babbitt9 avatar Jun 16 '21 03:06 babbitt9

@babbitt9 can you share the POCO class and the corresponding map so we can reproduce this issue?

ddimkovikj avatar Aug 11 '21 10:08 ddimkovikj

I'm archiving this repository as I'm not using this library myself anymore and have no time maintaining it. Thanks for using it.

henkmollema avatar Apr 19 '23 13:04 henkmollema