Inferred view key - obey nulliff isnull

Inferred view key - obey nulliff isnull

Postby 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?
mvccms-jon
 
Posts: 3
Joined: Sat 14 Apr 2012 15:21

Re: Inferred view key - obey nulliff isnull

Postby 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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Re: Inferred view key - obey nulliff isnull

Postby 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 :>
mvccms-jon
 
Posts: 3
Joined: Sat 14 Apr 2012 15:21


Return to dotConnect for PostgreSQL