Hi,
I'm doing more Entity Framework testing with the trial version (3.75.31) and I have a couple questions:
1. Are views supported? In the entity data model wizard, after I specify my connection string, I can see the views in my database. However, even if I select them, they are not added to the entity model.
2. Are user defined types supported? In my test case, I have a table with a column of type "geometry" (i.e. defined by PostGIS), but it does not show up in the model. It would be difficult to map them to anything other than strings, but that may be helpful anyways.
Thanks,
Anthony
Views and user defined types
The latest build (3.75.32) of PostgreSQLDirect .NET is available. It supports views in EDM Wizard .
You can download it from http://www.devart.com/pgsqlnet/download.html or from Registered Users' Area (for the Subscription program members only).
More about new release: http://devart.com/forums/viewtopic.php?t=12845
You can download it from http://www.devart.com/pgsqlnet/download.html or from Registered Users' Area (for the Subscription program members only).
More about new release: http://devart.com/forums/viewtopic.php?t=12845
Thanks for the new build. Everything seems to work as expected with one exception. All columns marked as NOT NULL in the database are mapped with "Entity Key = True" in the EDM.
For example, given this table definition:
and this view definition:
If I add view1 as an entity in my EDM, then "id", "field1", and "field3" will be set to "Entity Key = True". That causes a few problems, such as being unable to map those columns as associations (e.g. "field3" could be a foreign key on another table).
Regards,
Anthony
For example, given this table definition:
Code: Select all
CREATE TABLE myschema.table1
(
id integer NOT NULL DEFAULT nextval('table1_id_seq'::regclass),
field1 text NOT NULL,
field2 text,
field3 integer NOT NULL,
CONSTRAINT table1_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);
Code: Select all
CREATE OR REPLACE VIEW myschema.view1 AS
SELECT table1.id, table1.field1, table1.field2, table1.field3
FROM table1
WHERE table1.field3 = 1;
Regards,
Anthony
Good point, that makes sense. It's not trivial to figure out which fields are keys in a view.
What if none of the fields were marked as "Entity Key = True"? That way, it would be possible to manually define all associations for that view in the EDM. It would be easier to work with than having all NOT NULL fields set that way.
Regards,
Anthony
What if none of the fields were marked as "Entity Key = True"? That way, it would be possible to manually define all associations for that view in the EDM. It would be easier to work with than having all NOT NULL fields set that way.
Regards,
Anthony