本文整理汇总了C#中System.Data.Metadata.Edm.EntitySet类的典型用法代码示例。如果您正苦于以下问题:C# EntitySet类的具体用法?C# EntitySet怎么用?C# EntitySet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntitySet类属于System.Data.Metadata.Edm命名空间,在下文中一共展示了EntitySet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EFTableProvider
public EFTableProvider(EFDataModelProvider dataModel, EntitySet entitySet, EntityType entityType,
Type entityClrType, Type parentEntityClrType, Type rootEntityClrType, string name)
: base(dataModel) {
EntityType = entityClrType;
Name = name;
DataContextPropertyName = entitySet.Name;
ParentEntityType = parentEntityClrType;
RootEntityType = rootEntityClrType;
var genericMethod = DataModel.ContextType.GetMethod("CreateQuery");
CreateQueryMethod = genericMethod.MakeGenericMethod(EntityType);
CreateQueryString = CreateEntitySqlQueryString(entitySet);
var keyMembers = entityType.KeyMembers;
// columns (entity properties)
// note 1: keys are also available through es.ElementType.KeyMembers
// note 2: this includes "nav properties", kind of fancy, two-way relationship objects
var columns = new List<ColumnProvider>();
foreach (EdmMember m in entityType.Members) {
if (EFColumnProvider.IsSupportedEdmMemberType(m) && IsPublicProperty(entityClrType, m.Name)) {
EFColumnProvider entityMember = new EFColumnProvider(entityType, this, m, keyMembers.Contains(m));
columns.Add(entityMember);
}
}
_roColumns = new ReadOnlyCollection<ColumnProvider>(columns);
}
示例2: EdmTableProvider
public EdmTableProvider(EdmDataModelProvider dataModel, EntitySet entitySet, EntityType entityType, string name,
bool isReadonly, bool supportPagingAndSorting)
: base(dataModel)
{
_isReadonly = isReadonly;
SupportPaging = supportPagingAndSorting;
Name = name;
DataContextPropertyName = entitySet.Name;
EdmEntityType = entityType;
var keyMembers = entityType.KeyMembers;
// columns (entity properties)
// note 1: keys are also available through es.ElementType.KeyMembers
// note 2: this includes "nav properties", kind of fancy, two-way relationship objects
var columns = new List<ColumnProvider>();
foreach (EdmMember m in entityType.Members) {
if (EdmColumnProvider.IsSupportedEdmMemberType(m)) {
var entityMember = new EdmColumnProvider(entityType, this, m, keyMembers.Contains(m), supportPagingAndSorting);
columns.Add(entityMember);
}
}
_roColumns = new ReadOnlyCollection<ColumnProvider>(columns);
}
示例3: StorageMappingFragment
/// <summary>
/// Construct a new Mapping Fragment object
/// </summary>
/// <param name="tableExtent"></param>
/// <param name="typeMapping"></param>
internal StorageMappingFragment(EntitySet tableExtent, StorageTypeMapping typeMapping, bool distinctFlag) {
Debug.Assert(tableExtent != null, "Table should not be null when constructing a Mapping Fragment");
Debug.Assert(typeMapping != null, "TypeMapping should not be null when constructing a Mapping Fragment");
this.m_tableExtent = tableExtent;
this.m_typeMapping = typeMapping;
this.m_isSQueryDistinct = distinctFlag;
}
示例4: ObjectStateEntry
// ObjectStateEntry will not be detached and creation will be handled from ObjectStateManager
internal ObjectStateEntry(ObjectStateManager cache, EntitySet entitySet, EntityState state)
{
Debug.Assert(cache != null, "cache cannot be null.");
_cache = cache;
_entitySet = entitySet;
_state = state;
}
示例5: ObjectStateEntry
// ObjectStateEntry will not be detached and creation will be handled from ObjectStateManager
internal ObjectStateEntry(ObjectStateManager cache, EntitySet entitySet, EntityState state)
{
//Contract.Requires(cache != null);
_cache = cache;
_entitySet = entitySet;
_state = state;
}
示例6: EntityRecordInfo
public EntityRecordInfo(EntityType metadata, IEnumerable<EdmMember> memberInfo, EntityKey entityKey, EntitySet entitySet)
: base(TypeUsage.Create(metadata), memberInfo)
{
//Contract.Requires(entityKey != null);
//Contract.Requires(entitySet != null);
_entityKey = entityKey;
ValidateEntityType(entitySet);
}
示例7: NewEntityBaseOp
private readonly List<RelProperty> m_relProperties; // list of relationship properties for which we have values
#endregion
#region constructors
internal NewEntityBaseOp(OpType opType, TypeUsage type, bool scoped, EntitySet entitySet, List<RelProperty> relProperties)
: base(opType, type)
{
Debug.Assert(scoped || entitySet == null, "entitySet cann't be set of constructor isn't scoped");
Debug.Assert(relProperties != null, "expected non-null list of rel-properties");
m_scoped = scoped;
m_entitySet = entitySet;
m_relProperties = relProperties;
}
示例8: TableChangeProcessor
/// <summary>
/// Constructs processor based on the contents of a change node.
/// </summary>
/// <param name="table">Table for which changes are being processed.</param>
internal TableChangeProcessor(EntitySet table)
{
EntityUtil.CheckArgumentNull(table, "table");
m_table = table;
// cache information about table key
m_keyOrdinals = InitializeKeyOrdinals(table);
}
示例9: EntityRecordInfo
/// <summary>
///
/// </summary>
/// <param name="metadata"></param>
/// <param name="memberInfo"></param>
/// <param name="entityKey"></param>
public EntityRecordInfo(EntityType metadata, IEnumerable<EdmMember> memberInfo, EntityKey entityKey, EntitySet entitySet)
: base(TypeUsage.Create(metadata), memberInfo) {
EntityUtil.CheckArgumentNull<EntityKey>(entityKey, "entityKey");
EntityUtil.CheckArgumentNull(entitySet, "entitySet");
_entityKey = entityKey;
_entitySet = entitySet;
ValidateEntityType(entitySet);
}
示例10: TableChangeProcessor
/// <summary>
/// Constructs processor based on the contents of a change node.
/// </summary>
/// <param name="table">Table for which changes are being processed.</param>
internal TableChangeProcessor(EntitySet table)
{
//Contract.Requires(table != null);
m_table = table;
// cache information about table key
m_keyOrdinals = InitializeKeyOrdinals(table);
}
示例11: DiscriminatedEntityIdentity
private readonly EntitySet[] m_entitySetMap; // optional dictionary that maps values to entitysets
/// <summary>
/// Simple constructor
/// </summary>
/// <param name="entitySetColumn">column map representing the entityset</param>
/// <param name="entitySetMap">Map from value -> the appropriate entityset</param>
/// <param name="keyColumns">list of key columns</param>
internal DiscriminatedEntityIdentity(
SimpleColumnMap entitySetColumn, EntitySet[] entitySetMap,
SimpleColumnMap[] keyColumns)
: base(keyColumns)
{
Debug.Assert(entitySetColumn != null, "Must specify a column map to identify the entity set");
Debug.Assert(entitySetMap != null, "Must specify a dictionary to look up entitysets");
m_entitySetColumn = entitySetColumn;
m_entitySetMap = entitySetMap;
}
示例12: DiscriminatorMap
private DiscriminatorMap(DbPropertyExpression discriminator,
List<KeyValuePair<object, EntityType>> typeMap,
Dictionary<EdmProperty, DbExpression> propertyMap,
Dictionary<Query.InternalTrees.RelProperty, DbExpression> relPropertyMap,
EntitySet entitySet)
{
this.Discriminator = discriminator;
this.TypeMap = typeMap.AsReadOnly();
this.PropertyMap = propertyMap.ToList().AsReadOnly();
this.RelPropertyMap = relPropertyMap.ToList().AsReadOnly();
this.EntitySet = entitySet;
}
示例13: GetAllStateEntries
/// <summary>
/// Finds all markup associated with the given source.
/// </summary>
/// <param name="source">Source expression. Must not be null.</param>
/// <param name="translator">Translator containing session information.</param>
/// <param name="sourceTable">Table from which the exception was thrown (must not be null).</param>
/// <returns>Markup.</returns>
internal static ReadOnlyCollection<IEntityStateEntry> GetAllStateEntries(PropagatorResult source, UpdateTranslator translator,
EntitySet sourceTable)
{
Debug.Assert(null != source);
Debug.Assert(null != translator);
Debug.Assert(null != sourceTable);
SourceInterpreter interpreter = new SourceInterpreter(translator, sourceTable);
interpreter.RetrieveResultMarkup(source);
return new ReadOnlyCollection<IEntityStateEntry>(interpreter.m_stateEntries);
}
示例14: DiscriminatorMap
private DiscriminatorMap(
DbPropertyExpression discriminator,
List<KeyValuePair<object, EntityType>> typeMap,
Dictionary<EdmProperty, DbExpression> propertyMap,
Dictionary<RelProperty, DbExpression> relPropertyMap,
EntitySet entitySet)
{
Discriminator = discriminator;
TypeMap = typeMap.AsReadOnly();
PropertyMap = propertyMap.ToList().AsReadOnly();
RelPropertyMap = relPropertyMap.ToList().AsReadOnly();
EntitySet = entitySet;
}
示例15: CreateFunctionImportStructuralTypeColumnMap
/// <summary>
/// Creates a column map for the given reader and function mapping.
/// </summary>
internal static CollectionColumnMap CreateFunctionImportStructuralTypeColumnMap(
DbDataReader storeDataReader, FunctionImportMappingNonComposable mapping, int resultSetIndex, EntitySet entitySet,
StructuralType baseStructuralType)
{
var resultMapping = mapping.GetResultMapping(resultSetIndex);
Debug.Assert(resultMapping != null);
if (resultMapping.NormalizedEntityTypeMappings.Count == 0) // no explicit mapping; use default non-polymorphic reader
{
// if there is no mapping, create default mapping to root entity type or complex type
Debug.Assert(!baseStructuralType.Abstract, "mapping loader must verify abstract types have explicit mapping");
return CreateColumnMapFromReaderAndType(
storeDataReader, baseStructuralType, entitySet, resultMapping.ReturnTypeColumnsRenameMapping);
}
// the section below deals with the polymorphic entity type mapping for return type
var baseEntityType = baseStructuralType as EntityType;
Debug.Assert(null != baseEntityType, "We should have entity type here");
// Generate column maps for all discriminators
var discriminatorColumns = CreateDiscriminatorColumnMaps(storeDataReader, mapping, resultSetIndex);
// Generate default maps for all mapped entity types
var mappedEntityTypes = new HashSet<EntityType>(resultMapping.MappedEntityTypes);
mappedEntityTypes.Add(baseEntityType); // make sure the base type is represented
var typeChoices = new Dictionary<EntityType, TypedColumnMap>(mappedEntityTypes.Count);
ColumnMap[] baseTypeColumnMaps = null;
foreach (var entityType in mappedEntityTypes)
{
var propertyColumnMaps = GetColumnMapsForType(storeDataReader, entityType, resultMapping.ReturnTypeColumnsRenameMapping);
var entityColumnMap = CreateEntityTypeElementColumnMap(
storeDataReader, entityType, entitySet, propertyColumnMaps, resultMapping.ReturnTypeColumnsRenameMapping);
if (!entityType.Abstract)
{
typeChoices.Add(entityType, entityColumnMap);
}
if (entityType == baseStructuralType)
{
baseTypeColumnMaps = propertyColumnMaps;
}
}
// 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.
var polymorphicMap = new MultipleDiscriminatorPolymorphicColumnMap(
TypeUsage.Create(baseStructuralType), baseStructuralType.Name, baseTypeColumnMaps, discriminatorColumns, typeChoices,
(object[] discriminatorValues) => mapping.Discriminate(discriminatorValues, resultSetIndex));
CollectionColumnMap collection = new SimpleCollectionColumnMap(
baseStructuralType.GetCollectionType().TypeUsage, baseStructuralType.Name, polymorphicMap, null, null);
return collection;
}