本文整理汇总了C#中IEdmModel.GetDataServiceVersion方法的典型用法代码示例。如果您正苦于以下问题:C# IEdmModel.GetDataServiceVersion方法的具体用法?C# IEdmModel.GetDataServiceVersion怎么用?C# IEdmModel.GetDataServiceVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdmModel
的用法示例。
在下文中一共展示了IEdmModel.GetDataServiceVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldValidateComplexPropertyNullValue
internal static bool ShouldValidateComplexPropertyNullValue(IEdmModel model)
{
Version edmVersion = model.GetEdmVersion();
Version dataServiceVersion = model.GetDataServiceVersion();
if (((edmVersion != null) && (dataServiceVersion != null)) && (edmVersion < ODataVersion.V3.ToDataServiceVersion()))
{
return false;
}
return true;
}
示例2: ShouldValidateComplexPropertyNullValue
/// <summary>
/// Null validation of complex properties will be skipped if edm version is less than v3 and data service version exists.
/// In such cases, the provider decides what should be done if a null value is stored on a non-nullable complex property.
/// </summary>
/// <param name="model">The model containing the complex property.</param>
/// <returns>True if complex property should be validated for null values.</returns>
internal static bool ShouldValidateComplexPropertyNullValue(IEdmModel model)
{
DebugUtils.CheckNoExternalCallers();
Debug.Assert(model != null, "For null validation model is required.");
Debug.Assert(model.IsUserModel(), "For complex properties, the model should be user model.");
Version edmVersion = model.GetEdmVersion();
Version dataServiceVersion = model.GetDataServiceVersion();
if (edmVersion != null && dataServiceVersion != null && edmVersion < ODataVersion.V3.ToDataServiceVersion())
{
return false;
}
return true;
}