I am migrating my company application (which is currently running through SQL Server and Oracle) to ASP NET MVC and Entity Framework for preservation.
A create my Entity model based on the SQL Server database e separately I create SSDL for Oracle (for Oracle I use DevArt dotConnect for the Oracle provider) and I get some pain problems.
The primary keys of my table on SQL Server are decimal (13.0) and on Oracle the number (13.0), but Oracle maps it to Int64 and SQL Server to decimal, but I need this SQL Server map for Int64.
I make these changes manually on the Entity Data Model, and it works fine to create records, but when I need to delete or update some record, I got the following error:
The specified value is not an instance of type 'Edm.Decimal' Parameter name: value
in System.Data.Common.CommandTrees.DbConstantExpression..ctor (DbCommandTree commandTree, Object value, TypeUsage constantType)
in System.Data.Mapping.Update.Internal.UpdateCompiler.GenerateValueExpression (DbCommandTree commandTree, property EdmProatorty, value Prop
. Data.Mapping.Update.Internal.UpdateCompiler.GenerateEqualityExpression (DbModificationCommandTree commandTree, EdmProperty property, PropagatorResult value)
in System.Data.Mapping.Update.Internal.UpdateCompiler.BuildPredicate (DbModificationTermultimerMentorRemodimerTermodimertagentpreformatemourtributempregrampregrampregrampregramme rowMustBeTouched)
in System.Data.Mapping.Update.Internal.UpdateCompiler.BuildDeleteCommand (PropagatorResult oldRow, TableChangeProcessor processor)
in System.Data.Mapping.Update.Internal.TableChangeProcessor.CompileCommands (ChangeNode changeNode, UpdateCompiler compiler)
Can anybody help me?
Why is the entity framework binding so fixed? Could this be more flexible?
Ps .: The error I received, I suspect that this is due to the association.
I have an Entity named Province and another country, and I think that the relationship between these Entities is causing a problem when updating and deleting.
Hello,
Douglas Aguiar
source
share