向LINQ to SQL实体添加更多属性 [英] Adding more attributes to LINQ to SQL entity

查看:62
本文介绍了向LINQ to SQL实体添加更多属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 LINQ to SQL 生成的实体的某些属性添加可浏览属性>.

I want to add browsable attribute to some properties for entities generated by LINQ to SQL.

这是个好主意吗?由于这些实体是自动生成的,因此当我重新生成它们时(我添加的属性)可能会被覆盖.

Is it a good idea? Since these entities are auto-generated, and when I regenerate they (the attributes I have added) might be overwritten.

推荐答案

我可能会使用 Damien Guards LINQ to SQL T4模板,然后修改模板以包含所需的属性.然后,当您重新生成类时,将生成属性.

I would probably use Damien Guards LINQ to SQL T4 templates, and modify the template to include the attributes you need. Then the attributes will be generated when you regenerate the classes.

这篇关于向LINQ to SQL实体添加更多属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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