MetadataProperty.Create 方法

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

构造该 MetadataProperty 对象的工厂方法。

命名空间:  System.Data.Entity.Core.Metadata.Edm
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
Public Shared Function Create ( _
    name As String, _
    typeUsage As TypeUsage, _
    value As Object _
) As MetadataProperty
用法
Dim name As String 
Dim typeUsage As TypeUsage 
Dim value As Object 
Dim returnValue As MetadataProperty 

returnValue = MetadataProperty.Create(name, typeUsage, _
    value)
public static MetadataProperty Create(
    string name,
    TypeUsage typeUsage,
    Object value
)
public:
static MetadataProperty^ Create(
    String^ name, 
    TypeUsage^ typeUsage, 
    Object^ value
)
static member Create : 
        name:string * 
        typeUsage:TypeUsage * 
        value:Object -> MetadataProperty
public static function Create(
    name : String, 
    typeUsage : TypeUsage, 
    value : Object
) : MetadataProperty

参数

返回值

类型:System.Data.Entity.Core.Metadata.Edm.MetadataProperty
MetadataProperty 对象。

异常

例外 条件
NullReferenceException

typeUsage 为 null 时引发。

备注

新创建的 MetadataProperty 是只读的。

请参阅

参考

MetadataProperty 类

System.Data.Entity.Core.Metadata.Edm 命名空间