ScaffoldColumn在DBML类? [英] ScaffoldColumn in DBML classes?

查看:97
本文介绍了ScaffoldColumn在DBML类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个DBML文件,拖着我的表到设计。在我的网页,我的编辑形式显示为我的实体的主键字段。

I've created a DBML file, and dragged my tables onto the designer. On my pages, my editor form displays a field for the primary key for my entities.

有没有办法到ScaffoldColumn属性在DBML设计师添加到我的主键列一个表?

Is there a way to add a ScaffoldColumn attribute to my primary key column for a table in the DBML designer?

推荐答案

是的,你只失去有LINQ到SQL自动生成的类。

Yes, you'll just loose the ability to have linq-to-sql auto generate the classes.

不过MVC适用于的ViewModels好了很多,小的像DTO包含正是认为需要的类。在视图中使用的数据库和持久性类被认为是不好的形式,因为它紧紧地将你的整个应用程序在一起。

However MVC works a lot better with ViewModels, small DTO like classes which contain just what the view needs. Using database and persistence classes in your Views is considered bad form because it tightly couples your entire application together.

这篇关于ScaffoldColumn在DBML类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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