Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using EF with a view
Message
 
 
À
17/12/2015 16:57:26
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01629081
Message ID:
01629083
Vues:
34
Right, good point and this is what I've been looking at right now as well. The configuration was created automatically and right now the key is not defined correctly (it is based on all columns in the table). I'll see if re-running the tool will fix that problem.

There is another view which also seems to have wrong configuration (instead of a valid key it uses several columns as a key). I think that view works fine, but I haven't been testing it for some time.

I'm wondering if with schemabinding is enough to pass the table's key back to the view or I have to change all columns to use cast(col as ..) in order to make them nullable and not keys.

UPDATE. With schemabinding didn't work. I'll try casting all columns to proper types to make them nullable and see if it helps.

UPDATE. It works without schemabining but I do need to apply the cast trick to make only PK to be PK in the view.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform