If I drag-n-drop 2 tables with one-to-one relationship with linq to entities it works great, but with link to sql don't. It generate a one-to-many.
I use Oracle and many things doesn´t work with Linq to SQL that works with Linq to Entities.
Ex.:
NUMBER(10,0) are mapped as decimal instead int
NUMBER(1,0) are mapped as int instead bool
Functions that return NUMBER(10,0) OR NUMBER(9,0) are mapped as double instead int
There is a configuration to this? Why entity developer generate different types to de same tables?
Thaks.
One-to-one and number(10,0) are diferent between L2E and L2S
-
- Posts: 16
- Joined: Tue 23 Feb 2010 18:28
I have just checked using the latest 5.55.97 build of dotConnect for Oracle.
Both Entity Framework and LINQ to SQL models are generated as one-to-many and then
after changing the association cardinality the code is generated correctly.
Could you please provide me with the script you are experiencing the problem with?
Thank you for the suggestion regarding number mappings. I will let you know about the results of our discussion.
Both Entity Framework and LINQ to SQL models are generated as one-to-many and then
after changing the association cardinality the code is generated correctly.
Could you please provide me with the script you are experiencing the problem with?
Thank you for the suggestion regarding number mappings. I will let you know about the results of our discussion.
-
- Posts: 16
- Joined: Tue 23 Feb 2010 18:28
Yes, Entity Framework generete a 1 to 0...1 while Linq to SQL generate a 1 to *
Code: Select all
CREATE TABLE "PESSOA"
(
"ID" NUMBER(9,0) NOT NULL ENABLE,
CONSTRAINT "PESSOA_PK" PRIMARY KEY ("ID") ENABLE
);
CREATE TABLE "ALUNO"
(
"PESSOA" NUMBER(9,0) NOT NULL ENABLE,
CONSTRAINT "ALUNO_PK" PRIMARY KEY ("PESSOA") ENABLE,
CONSTRAINT "ALUNO_PESSOA_FK1" FOREIGN KEY ("PESSOA") REFERENCES "PESSOA" ("ID") ENABLE
);
Mapping difference
What about this part:
The problem is that in LINQ to SQL there is no way to map ANY oracle type to Boolean. Also, the mappings from http://www.devart.com/forums/viewtopic.php?t=15604 are not consistent with LINQ to SQL mappings. Would you please unify that?
Is it going to be fixed?NUMBER(10,0) are mapped as decimal instead int
NUMBER(1,0) are mapped as int instead bool
Functions that return NUMBER(10,0) OR NUMBER(9,0) are mapped as double instead int
The problem is that in LINQ to SQL there is no way to map ANY oracle type to Boolean. Also, the mappings from http://www.devart.com/forums/viewtopic.php?t=15604 are not consistent with LINQ to SQL mappings. Would you please unify that?