Entity Framework Common Issues

Problem: Unable to update model with new SQL View

Solution: 

Check the messages under Error List tab. If the message says "primary key is not defined" and "unable to infer primary key", make sure you have a primary key on the table. Simply, you may add ISNULL(ROW_NUMBER() OVER( ORDER BY ID), <value>) as PrimaryKey to your SQL View. 
*Please make sure you click "Run custom tool"

http://stackoverflow.com/questions/1013333/entity-framework-and-sql-server-view

Problem: Intellisense is not  working for updated model or Updating model doesn't reflect in DB Context


Solution: Please make sure you click "Run custom tool


http://stackoverflow.com/questions/14161277/after-updating-edmx-model-what-about-dbcontext

Problem : Duplicate rows in LINQ fetch via SQL View


Solution:


Make sure your inferred primary key is really unique.  Add ROW_NUMBER() OVER( ORDER BY ID) as PrimaryKey to your SQL View


http://www.itworld.com/development/361338/linq-net-returning-duplicate-rows-working-sql-view-solved


Comments

Popular posts from this blog

How to prepare your LOB app for Intune?

Information Architecture - Setup your term store to scale

Generate token signing .CER from ADFS Federation Metadata XML