EF4 CTP5 - Column Audit CreatedOn

First I tried to use the CTP EF4 code and wondered how to enable audit fields, such as CreatedOn (datetime), will it be filled when the element is saved, or do I need to do some sort of mapping?

Thanks in advance

Dotnetshadow

+3
source share
1 answer

If you want to fill them in your code or want EF to create a database for you, you need to map (at least represent them in your POCO class). If you have an existing database, and this column will never be presented in your application, you will not need a mapping. Instead, you can set a default value for this column (in MS SQL you will use GetDate () as the default value).

+1
source

Source: https://habr.com/ru/post/1787584/


All Articles