Hi everybody.
I have a problem with DateTime properties (.NET DateTime).
Using dotConnect for Oracle, it maps DateTime property on Oracle TIMESTAMP data type.
My problem is that I have another application that doesn't work with TIMESTAMP Oracle data type. It needs "DATE" type.
I tried to change the data type on the DB (manually), and I see that both applications will work (in our application, the user can insert at max minutes, so I don't lost any information).
So I'd like to know if there is any kind of setting that let me inform dotConnect to map DateTime property on Oracle DATE type instead of TIMESTAMP.
I don't want to do it for each property (like data attribute or special configuration for every property in the "OnModelCreating" event).
Thank you in advance.
DateTime mapping CodeFirst
Re: DateTime mapping CodeFirst
There are 3 ways to fix the issue currently (for each property separately):JoeRuspante wrote:So I'd like to know if there is any kind of setting that let me inform dotConnect to map DateTime property on Oracle DATE type instead of TIMESTAMP.
1. specify explicitly the server unicode data type (DATE) for your columns with ColumnAttribute (the TypeName property: http://msdn.microsoft.com/en-us/library ... .103).aspx )
2. fluent mapping:
2.1. specify explicitly the server unicode data type with the .HasColumnType(string columnType) method of property configuration
2.2. specify the zero precision via .HasPrecision(byte value)
An example of application with fluent mapping and detailed description of Code-First peculiarities is available at http://www.devart.com/blogs/dotconnect/ ... qlite.html
We will investigate the possibility of implementing the corresponding configuration option.JoeRuspante wrote:I don't want to do it for each property (like data attribute or special configuration for every property in the "OnModelCreating" event).
Re: DateTime mapping CodeFirst
The config.CodeFirstOptions.UseDateTimeAsDate option (default value is False) is added to treat DateTime properties without an explicitly specified server data type as DATE. We will post here when the corresponding build of dotConnect for Oracle is available for download.
-
- Posts: 54
- Joined: Mon 05 Jul 2010 23:08
Re: DateTime mapping CodeFirst
Thank you very much
Re: DateTime mapping CodeFirst
New build of dotConnect for Oracle 7.2.96 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=25020.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=25020.