主键+实体框架 [英] Primary key + entity framework

查看:96
本文介绍了主键+实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

我有一个MVC应用程序,该应用程序将从一些SQL服务器表中拖动报告.包含最大数据量的一个表没有主键,因为所有列都可以具有NULL值.到目前为止,我一直在使用Entity Framework 4.0来运行我的存储过程,并且一切正常.是否可以通过某种方式将没有PK的表包含到模型中?有什么办法可以解决这个问题?我真的不想使用ADO对象来解决此问题.

提前谢谢!
suunker

Hey,

I have an MVC-application that is going to drag reports from some SQL-server tables. The one table that consists the largest amount of data has no primary key, since all columns can have NULL values. I''ve been using Entity framework 4.0 to run my stored procedures so far, and it''s been working just fine. Is it possible to include this table that has no PK into the model in some way? Some way to go around this? I really don''t want to use the ADO-objects to solve this problem.

Thanks in advance!
suunker

推荐答案

向表中添加主键,没有理由没有主键.
Add a primary key to the table, there is no reason to not have one.


这篇关于主键+实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆