DbModelBuilder.Properties<T> 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
开始配置适用于模型中指定类型的所有基元属性的轻型约定。
命名空间: System.Data.Entity
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
<SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")> _
Public Function Properties(Of T) As PropertyConventionConfiguration
用法
Dim instance As DbModelBuilder
Dim returnValue As PropertyConventionConfiguration
returnValue = instance.Properties()
[SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public PropertyConventionConfiguration Properties<T>()
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1004:GenericMethodsShouldProvideTypeParameter")]
public:
generic<typename T>
PropertyConventionConfiguration^ Properties()
[<SuppressMessageAttribute("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")>]
member Properties : unit -> PropertyConventionConfiguration
JScript does not support generic types and methods.
类型参数
- T
此约定将适用于的属性类型。
返回值
类型:System.Data.Entity.ModelConfiguration.Configuration.PropertyConventionConfiguration
约定的配置对象。
备注
此约定将适用于指定类型的可为 null 和不可为 null 的属性。