如何在.NET 4中的实体框架中找出字段最大长度? [英] How to find out field maximum length in Entity Framework in .NET 4?

查看:144
本文介绍了如何在.NET 4中的实体框架中找出字段最大长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这个问题,EF中没有内置的方式v1来计算一个字段的长度。在.NET 4附带的实体框架中是否有内置的方式,如果是这样做?

According to this question, there's no built-in way in EF v1 to figure out the length of a field. Is there a built-in way to do so in the Entity Framework that ships with .NET 4, if so - how?

推荐答案

没有新的方式访问EF 4.0中的属性的长度。您仍然必须遍历元数据,如在您参考的问题的接受答案中所示

There is no new way to access the length of a property in EF 4.0. You still have to walk over the metadata - as shown in the accepted answer on the question you reference.

Alex James

Alex James

前EF团队成员!

这篇关于如何在.NET 4中的实体框架中找出字段最大长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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