Primary key tanımlamadığınız zaman aşağıdaki gibi hata almaktayız:
Unable to update the EntitySet '...' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.
EF 4.0 composite key (çok alanlı primary key tanımı) tanımını desteklemektedir. Özellikle bu tanım map tablolarında çok kullanılmaktadır.
Bir tabloda composite primary key yapma:
http://stackoverflow.com/questions/1545571/how-do-i-make-a-composite-key-with-sql-server-management-studio
Kaynaklar:
http://stackoverflow.com/questions/7583770/unable-to-update-the-entityset-because-it-has-a-definingquery-and-no-updatefu
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/220262bd-85d4-4f29-96a8-4a7d1d2c8293/
http://blogs.msdn.com/b/adonet/archive/2008/05/22/how-referential-integrity-works.aspx
http://www.luisrocha.net/2010/11/creating-composite-keys-using-code.html
http://stackoverflow.com/questions/1925632/composite-db-keys-with-entity-framework-4-0?rq=1
http://sadullahkeles.wordpress.com/2011/04/18/entity-framework-insert-hatasi/
C#, .NET, .Net Core
ASP.NET MVC, ASP.NET Web Forms, ASP.NET Core
HTML 5, CSS 3, Javascript, jQuery, Bootstrap
Entity Framework, NHibernate, Dapper
Sql Server, MySql, Oracle
Windows Server, Ubuntu, Debian, Pardus
Xamarin Forms, Android Studio
--- The future of the open web platform is looking very bright!
--- .NET is a free, cross-platform, open source developer platform for building any app.
Google Analytics İzleme
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder