Inferred view key - obey nulliff isnull

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
mvccms-jon
Posts: 3
Joined: Sat 14 Apr 2012 15:21
Contact:

Inferred view key - obey nulliff isnull

Post by mvccms-jon » Fri 27 Apr 2012 16:19

Hey, when we import views we don't seem to have any control over the inferred keys and thus null columns.

With the ms sql version the workaround is to use nulliff and isnull (http://stackoverflow.com/questions/1013 ... w-question).

This doesn't seem to be working with dotconnect postgres, it seems you are making a column a key and not null if it is a pk in a joined view but this defeats left joins.

We like left joins here and really need control over inferred keys and the null-ability of those columns or we are going to be left hand editing the edmx after every update from the db.

In the short term is there a template code generation file I can edit to work around this?

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Inferred view key - obey nulliff isnull

Post by Shalex » Mon 30 Apr 2012 08:35

We recommend you using Entity Developer (the Devart Entity Model item, *.edml) - it will create an entity basing on your view, and you will be able to set its EntityKeys easily in the design time. After this to preserve settings from overriding, clear a selection for this view in Update Model From Database every time when running the wizard.

mvccms-jon
Posts: 3
Joined: Sat 14 Apr 2012 15:21
Contact:

Re: Inferred view key - obey nulliff isnull

Post by mvccms-jon » Mon 30 Apr 2012 12:37

Shalex wrote:We recommend you using Entity Developer (the Devart Entity Model item, *.edml) - it will create an entity basing on your view, and you will be able to set its EntityKeys easily in the design time. After this to preserve settings from overriding, clear a selection for this view in Update Model From Database every time when running the wizard.

Cool, I hadn't really dug into working with edml yet and didn't realize I got it with the pro dotconnect. I will start working with it today, thanks for the response :>

Post Reply