igor-tkachev / bltoolkit

Business Logic Toolkit for .NET
MIT License
297 stars 112 forks source link

Cannot save nullable datetime #400

Closed sinancx closed 7 years ago

sinancx commented 7 years ago

Hi All,

We have problems to save nullable datetime in oracle.

[MapField("XYZ"], Nullable]
public DateTime? ValidFrom{get;set;}

If the value of the Property is null, we become the following error:

Exception thrown: 'System.ArgumentOutOfRangeException' in Oracle.ManagedDataAccess.dll
   bei Oracle.ManagedDataAccess.Client.OracleParameter.set_DbType(DbType value)
   bei BLToolkit.Data.DataProvider.OdpManagedDataProvider.BLToolkitExtension.OracleParameterWrap.System.Data.IDataParameter.set_DbType(DbType value)
   bei BLToolkit.Data.DbManager.Parameter(ParameterDirection parameterDirection, String parameterName, Object value, DbType dbType)
   bei BLToolkit.Data.DbManager.Parameter(String parameterName, Object value, DbType dbType)
   bei BLToolkit.DataAccess.SqlQueryInfo.GetParameters(DbManager db, Object obj)
   bei BLToolkit.DataAccess.SqlQuery`1.Insert(DbManager db, T obj)
   bei BLToolkit.DataAccess.SqlQuery`1.Insert(T obj)

Any help is appreciated.

Regards

Sinan

ili commented 7 years ago

I'll take a look in next few days.

ili commented 7 years ago

fixed in 4.3.9 nugets updated

sinancx commented 7 years ago

Great job! Thanks for the quick support!

ili commented 7 years ago

Not at all. Please consider migrating to linq2db :)

sinancx commented 7 years ago

linq2db looks very good and similar to BLToolkit Linq Extension.

What's the difference between the two? and Which one will be supported more in the future?

Thanks and kind regards

Sinan

ili commented 7 years ago

linq2db is linq-only (and you are right, it is similar with BLToolkit Linq, because it is from the same author: @igor-tkachev ) no DataAccessors, no EditableObjects (but you can generate Editable objects from database with T4 templates), no ObjectBinder, reflection, etc...

BLToolkit is suspended, no new features would be implemented, only small bug fixes (as one you faced with). linq2db is live & growing project. So we do suggest to start new projects with inq2db & to migrate old, of possible.

sinancx commented 7 years ago

Thanks for the useful information! We liked BLToolkit and I am pretty sure linq2db will be great, as well.

Good luck!