本文整理汇总了C#中System.Data.Entity.Core.Metadata.Edm.EdmType.GetCollectionType方法的典型用法代码示例。如果您正苦于以下问题:C# EdmType.GetCollectionType方法的具体用法?C# EdmType.GetCollectionType怎么用?C# EdmType.GetCollectionType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Entity.Core.Metadata.Edm.EdmType
的用法示例。
在下文中一共展示了EdmType.GetCollectionType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MetadataProperty
// <summary>
// The constructor for MetadataProperty taking in all the ingredients for creating TypeUsage and the actual value
// </summary>
// <param name="name"> The name of the attribute </param>
// <param name="edmType"> The edm type of the attribute </param>
// <param name="isCollectionType"> Whether the collection type of the given edm type should be used </param>
// <param name="value"> The value of the attribute </param>
internal MetadataProperty(string name, EdmType edmType, bool isCollectionType, object value)
{
DebugCheck.NotNull(edmType);
_name = name;
_value = value;
if (isCollectionType)
{
_typeUsage = TypeUsage.Create(edmType.GetCollectionType());
}
else
{
_typeUsage = TypeUsage.Create(edmType);
}
_propertyKind = PropertyKind.System;
}
示例2: MetadataProperty
/// <summary>
/// The constructor for MetadataProperty taking in all the ingredients for creating TypeUsage and the actual value
/// </summary>
/// <param name="name">The name of the attribute</param>
/// <param name="edmType">The edm type of the attribute</param>
/// <param name="isCollectionType">Whether the collection type of the given edm type should be used</param>
/// <param name="value">The value of the attribute</param>
internal MetadataProperty(string name, EdmType edmType, bool isCollectionType, object value)
{
Contract.Requires(edmType != null);
_name = name;
_value = value;
if (isCollectionType)
{
_typeUsage = TypeUsage.Create(edmType.GetCollectionType());
}
else
{
_typeUsage = TypeUsage.Create(edmType);
}
_propertyKind = PropertyKind.System;
}
示例3: CreateColumnMapFromReaderAndType
/// <summary>
/// Build the collectionColumnMap from a store datareader, a type and an entitySet.
/// </summary>
/// <param name="storeDataReader"> </param>
/// <param name="edmType"> </param>
/// <param name="entitySet"> </param>
/// <returns> </returns>
internal virtual CollectionColumnMap CreateColumnMapFromReaderAndType(
DbDataReader storeDataReader, EdmType edmType, EntitySet entitySet,
Dictionary<string, FunctionImportReturnTypeStructuralTypeColumnRenameMapping> renameList)
{
Debug.Assert(
Helper.IsEntityType(edmType) || null == entitySet,
"The specified non-null EntitySet is incompatible with the EDM type specified.");
// Next, build the ColumnMap directly from the edmType and entitySet provided.
var propertyColumnMaps = GetColumnMapsForType(storeDataReader, edmType, renameList);
ColumnMap elementColumnMap = null;
// NOTE: We don't have a null sentinel here, because the stored proc won't
// return one anyway; we'll just presume the data's always there.
if (Helper.IsRowType(edmType))
{
elementColumnMap = new RecordColumnMap(TypeUsage.Create(edmType), edmType.Name, propertyColumnMaps, null);
}
else if (Helper.IsComplexType(edmType))
{
elementColumnMap = new ComplexTypeColumnMap(TypeUsage.Create(edmType), edmType.Name, propertyColumnMaps, null);
}
else if (Helper.IsScalarType(edmType))
{
if (storeDataReader.FieldCount != 1)
{
throw new EntityCommandExecutionException(Strings.ADP_InvalidDataReaderFieldCountForScalarType);
}
elementColumnMap = new ScalarColumnMap(TypeUsage.Create(edmType), edmType.Name, 0, 0);
}
else if (Helper.IsEntityType(edmType))
{
elementColumnMap = CreateEntityTypeElementColumnMap(
storeDataReader, edmType, entitySet, propertyColumnMaps, null /*renameList*/);
}
else
{
Debug.Assert(false, "unexpected edmType?");
}
CollectionColumnMap collection = new SimpleCollectionColumnMap(
edmType.GetCollectionType().TypeUsage, edmType.Name, elementColumnMap, null, null);
return collection;
}