当前位置: 首页>>代码示例>>C#>>正文


C# Edm.EntitySetBase类代码示例

本文整理汇总了C#中System.Data.Entity.Core.Metadata.Edm.EntitySetBase的典型用法代码示例。如果您正苦于以下问题:C# EntitySetBase类的具体用法?C# EntitySetBase怎么用?C# EntitySetBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EntitySetBase类属于System.Data.Entity.Core.Metadata.Edm命名空间,在下文中一共展示了EntitySetBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StorageModificationFunctionMapping

        internal StorageModificationFunctionMapping(
            EntitySetBase entitySet,
            EntityTypeBase entityType,
            EdmFunction function,
            IEnumerable<StorageModificationFunctionParameterBinding> parameterBindings,
            FunctionParameter rowsAffectedParameter,
            IEnumerable<StorageModificationFunctionResultBinding> resultBindings)
        {
            Contract.Requires(entitySet != null);
            Contract.Requires(function != null);
            Contract.Requires(parameterBindings != null);

            Function = function;
            RowsAffectedParameter = rowsAffectedParameter;
            ParameterBindings = parameterBindings.ToList().AsReadOnly();
            if (null != resultBindings)
            {
                var bindings = resultBindings.ToList();
                if (0 < bindings.Count)
                {
                    ResultBindings = bindings.AsReadOnly();
                }
            }
            CollocatedAssociationSetEnds =
                GetReferencedAssociationSetEnds(entitySet as EntitySet, entityType as EntityType, parameterBindings)
                    .ToList()
                    .AsReadOnly();
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:28,代码来源:StorageModificationFunctionMapping.cs

示例2: TableMD

        /// <summary>
        /// Creates a "flattened" table definition. 
        /// 
        /// The table has one column for each specified property in the "properties" parameter. 
        /// The name and datatype of each table column are taken from the corresponding property.
        /// 
        /// The keys of the table (if any) are those specified in the "keyProperties" parameter
        /// 
        /// The table may correspond to an entity set (if the entityset parameter was non-null)
        /// </summary>
        /// <param name="properties">prperties corresponding to columns of the table</param>
        /// <param name="keyProperties"></param>
        /// <param name="extent">entityset corresponding to the table (if any)</param>
        internal TableMD(
            IEnumerable<EdmProperty> properties, IEnumerable<EdmMember> keyProperties,
            EntitySetBase extent)
            : this(extent)
        {
            var columnMap = new Dictionary<string, ColumnMD>();
            m_flattened = true;

            foreach (var p in properties)
            {
                var newColumn = new ColumnMD(p);
                m_columns.Add(newColumn);
                columnMap[p.Name] = newColumn;
            }
            foreach (var p in keyProperties)
            {
                ColumnMD keyColumn;
                if (!columnMap.TryGetValue(p.Name, out keyColumn))
                {
                    Debug.Assert(false, "keyMember not in columns?");
                }
                else
                {
                    m_keys.Add(keyColumn);
                }
            }
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:40,代码来源:TableMD.cs

示例3: GetView

        /// <summary>
        /// Gets a view corresponding to the specified extent.
        /// </summary>
        /// <param name="extent">The extent.</param>
        /// <returns>The mapping view, or null if the extent is not associated with a mapping view.</returns>
        public override DbMappingView GetView(EntitySetBase extent)
        {
            if (extent == null)
            {
                throw new ArgumentNullException("extent");
            }

            var extentName = extent.EntityContainer.Name + "." + extent.Name;

            if (extentName == "CodeFirstDatabase.Company")
            {
                return GetView0();
            }

            if (extentName == "CodeFirstDatabase.CompanyProduct")
            {
                return GetView1();
            }

            if (extentName == "CompanyContext.Company")
            {
                return GetView2();
            }

            if (extentName == "CompanyContext.CompanyProduct")
            {
                return GetView3();
            }

            return null;
        }
开发者ID:AlvisHuang,项目名称:TPIA,代码行数:36,代码来源:CompanyContext.Views.cs

示例4: GetView

        public override DbMappingView GetView(EntitySetBase extent)
        {
            var extentFullName = extent.EntityContainer.Name + "." + extent.Name;
            switch (extentFullName)
            {
                case "CodeFirstDatabase.PregenBlog":
                    View0Accessed = true;

                    return new DbMappingView(
@"SELECT VALUE -- Constructing PregenBlog
    [CodeFirstDatabaseSchema.PregenBlog](T1.PregenBlog_Id)
FROM (
    SELECT 
        T.Id AS PregenBlog_Id, 
        True AS _from0
    FROM CodeFirstContainer.PregenBlogs AS T
) AS T1");

                case "CodeFirstContainer.PregenBlogs":
                    View1Accessed = true;

                    return new DbMappingView(
@"SELECT VALUE -- Constructing PregenBlogs
    [CodeFirstNamespace.PregenBlog](T1.PregenBlog_Id)
FROM (
    SELECT 
        T.Id AS PregenBlog_Id, 
        True AS _from0
    FROM CodeFirstDatabase.PregenBlog AS T
) AS T1");

                default:
                    throw new InvalidOperationException();
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:35,代码来源:PregenObjectContextViews.cs

示例5: ModificationFunctionMapping

        /// <summary>
        /// Initializes a new ModificationFunctionMapping instance.
        /// </summary>
        /// <param name="entitySet">The entity or association set.</param>
        /// <param name="entityType">The entity or association type.</param>
        /// <param name="function">The metadata of function to which we should bind.</param>
        /// <param name="parameterBindings">Bindings for function parameters.</param>
        /// <param name="rowsAffectedParameter">The output parameter producing number of rows affected.</param>
        /// <param name="resultBindings">Bindings for the results of function evaluation</param>
        public ModificationFunctionMapping(
            EntitySetBase entitySet,
            EntityTypeBase entityType,
            EdmFunction function,
            IEnumerable<ModificationFunctionParameterBinding> parameterBindings,
            FunctionParameter rowsAffectedParameter,
            IEnumerable<ModificationFunctionResultBinding> resultBindings)
        {
            Check.NotNull(entitySet, "entitySet");
            Check.NotNull(function, "function");
            Check.NotNull(parameterBindings, "parameterBindings");

            _function = function;
            _rowsAffectedParameter = rowsAffectedParameter;

            _parameterBindings = new ReadOnlyCollection<ModificationFunctionParameterBinding>(parameterBindings.ToList());

            if (null != resultBindings)
            {
                var bindings = resultBindings.ToList();

                if (0 < bindings.Count)
                {
                    _resultBindings = new ReadOnlyCollection<ModificationFunctionResultBinding>(bindings);
                }
            }

            _collocatedAssociationSetEnds =
                new ReadOnlyCollection<AssociationSetEnd>(
                    GetReferencedAssociationSetEnds(entitySet as EntitySet, entityType as EntityType, parameterBindings)
                        .ToList());
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:41,代码来源:ModificationFunctionMapping.cs

示例6: Create

 /// <summary>
 ///     Recursively generates <see cref="MemberPath" />s for the members of the types stored in the <paramref name="extent" />.
 /// </summary>
 internal static MemberProjectionIndex Create(EntitySetBase extent, EdmItemCollection edmItemCollection)
 {
     // We generate the indices for the projected slots as we traverse the metadata.
     var index = new MemberProjectionIndex();
     GatherPartialSignature(index, edmItemCollection, new MemberPath(extent), false); // need not only keys
     return index;
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:MemberProjectionIndex.cs

示例7: StorageModificationFunctionMapping

        internal StorageModificationFunctionMapping(
            EntitySetBase entitySet,
            EntityTypeBase entityType,
            EdmFunction function,
            IEnumerable<StorageModificationFunctionParameterBinding> parameterBindings,
            FunctionParameter rowsAffectedParameter,
            IEnumerable<StorageModificationFunctionResultBinding> resultBindings)
        {
            DebugCheck.NotNull(entitySet);
            DebugCheck.NotNull(function);
            DebugCheck.NotNull(parameterBindings);

            _function = function;
            _rowsAffectedParameter = rowsAffectedParameter;

            ParameterBindings = parameterBindings.ToList().AsReadOnly();

            if (null != resultBindings)
            {
                var bindings = resultBindings.ToList();

                if (0 < bindings.Count)
                {
                    ResultBindings = bindings.AsReadOnly();
                }
            }

            CollocatedAssociationSetEnds =
                GetReferencedAssociationSetEnds(entitySet as EntitySet, entityType as EntityType, parameterBindings)
                    .ToList()
                    .AsReadOnly();
        }
开发者ID:hallco978,项目名称:entityframework,代码行数:32,代码来源:StorageModificationFunctionMapping.cs

示例8: CreateGeneratedView

        /// <summary>
        ///     Creates generated view object for the combination of the <paramref name="extent" /> and the <paramref name="type" />.
        ///     This constructor is used for regular cell-based view generation.
        /// </summary>
        internal static GeneratedView CreateGeneratedView(
            EntitySetBase extent,
            EdmType type,
            DbQueryCommandTree commandTree,
            string eSQL,
            StorageMappingItemCollection mappingItemCollection,
            ConfigViewGenerator config)
        {
            // If config.GenerateEsql is specified, eSQL must be non-null.
            // If config.GenerateEsql is false, commandTree is non-null except the case when loading pre-compiled eSQL views.
            Debug.Assert(!config.GenerateEsql || !String.IsNullOrEmpty(eSQL), "eSQL must be specified");

            DiscriminatorMap discriminatorMap = null;
            if (commandTree != null)
            {
                commandTree = ViewSimplifier.SimplifyView(extent, commandTree);

                // See if the view matches the "discriminated" pattern (allows simplification of generated store commands)
                if (extent.BuiltInTypeKind
                    == BuiltInTypeKind.EntitySet)
                {
                    if (DiscriminatorMap.TryCreateDiscriminatorMap((EntitySet)extent, commandTree.Query, out discriminatorMap))
                    {
                        Debug.Assert(discriminatorMap != null, "discriminatorMap == null after it has been created");
                    }
                }
            }

            return new GeneratedView(extent, type, commandTree, eSQL, discriminatorMap, mappingItemCollection, config);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:34,代码来源:GeneratedView.cs

示例9: CreateGeneratedViewForFKAssociationSet

 /// <summary>
 ///     Creates generated view object for the combination of the <paramref name="extent" /> and the <paramref name="type" />.
 ///     This constructor is used for FK association sets only.
 /// </summary>
 internal static GeneratedView CreateGeneratedViewForFKAssociationSet(
     EntitySetBase extent,
     EdmType type,
     DbQueryCommandTree commandTree,
     StorageMappingItemCollection mappingItemCollection,
     ConfigViewGenerator config)
 {
     return new GeneratedView(extent, type, commandTree, null, null, mappingItemCollection, config);
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:13,代码来源:GeneratedView.cs

示例10: TryGetEntityContainer

 internal bool TryGetEntityContainer(EntitySetBase item, out EntityContainer container)
 {
     if (item != null)
     {
         return itemToContainerMap.TryGetValue(item, out container);
     }
     container = null;
     return false;
 }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:9,代码来源:EdmModelParentMap.cs

示例11: GetView

        /// <summary>
        /// Gets a view corresponding to the specified extent.
        /// </summary>
        /// <param name="extent">The extent.</param>
        /// <returns>The mapping view, or null if the extent is not associated with a mapping view.</returns>
        public override DbMappingView GetView(EntitySetBase extent)
        {
            if (extent == null)
            {
                throw new ArgumentNullException("extent");
            }

            var extentName = extent.EntityContainer.Name + "." + extent.Name;

            return null;
        }
开发者ID:sergey36,项目名称:ConsoleApplication3,代码行数:16,代码来源:EntityframeworkDB.Views.cs

示例12: GetIsTypeOfMappingsForEntitySetAndType

 /// <summary>
 ///     Returns mappings for the given set/type only if the mapping applies also to childEntittyType either via IsTypeOf or explicitly specifying multiple types in mapping fragments.
 /// </summary>
 private static IEnumerable<StorageTypeMapping> GetIsTypeOfMappingsForEntitySetAndType(
     StorageMappingItemCollection mappingCollection, EntityContainer container, EntitySetBase entitySet, EntityTypeBase entityType,
     EntityTypeBase childEntityType)
 {
     foreach (var mapping in GetMappingsForEntitySetAndType(mappingCollection, container, entitySet, entityType))
     {
         if (mapping.IsOfTypes.Any(parentType => parentType.IsAssignableFrom(childEntityType))
             || mapping.Types.Contains(childEntityType))
         {
             yield return mapping;
         }
     }
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:16,代码来源:MappingMetadataHelper.cs

示例13: ExtentCqlBlock

 // <summary>
 // Creates an cql block representing the <paramref name="extent" /> (the FROM part).
 // SELECT is given by <paramref name="slots" />, WHERE by <paramref name="whereClause" /> and AS by
 // <paramref
 //     name="blockAliasNum" />
 // .
 // </summary>
 internal ExtentCqlBlock(
     EntitySetBase extent,
     CellQuery.SelectDistinct selectDistinct,
     SlotInfo[] slots,
     BoolExpression whereClause,
     CqlIdentifiers identifiers,
     int blockAliasNum)
     : base(slots, _emptyChildren, whereClause, identifiers, blockAliasNum)
 {
     m_extent = extent;
     m_nodeTableAlias = identifiers.GetBlockAlias();
     m_selectDistinct = selectDistinct;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:20,代码来源:ExtentCqlBlock.cs

示例14: GetView

        /// <summary>
        /// Gets a view corresponding to the specified extent.
        /// </summary>
        /// <param name="extent">The extent.</param>
        /// <returns>The mapping view, or null if the extent is not associated with a mapping view.</returns>
        public override DbMappingView GetView(EntitySetBase extent)
        {
            if (extent == null)
            {
                throw new ArgumentNullException("extent");
            }

            var extentName = extent.EntityContainer.Name + "." + extent.Name;

            if (extentName == "CodeFirstDatabase.Category")
            {
                return GetView0();
            }

            if (extentName == "CodeFirstDatabase.Location")
            {
                return GetView1();
            }

            if (extentName == "CodeFirstDatabase.Review")
            {
                return GetView2();
            }

            if (extentName == "DatabaseContext.Categories")
            {
                return GetView3();
            }

            if (extentName == "DatabaseContext.Locations")
            {
                return GetView4();
            }

            if (extentName == "DatabaseContext.Reviews")
            {
                return GetView5();
            }

            if (extentName == "DatabaseContext.Review_Category")
            {
                return GetView6();
            }

            if (extentName == "DatabaseContext.Review_Location")
            {
                return GetView7();
            }

            return null;
        }
开发者ID:danho,项目名称:ReviewsJoy,代码行数:56,代码来源:DatabaseContext.Views.cs

示例15: GetQualifiedPrefix

        public string GetQualifiedPrefix(EntitySetBase item)
        {
            Debug.Assert(ModelParentMap != null);

            string qualifiedPrefix = null;
            EntityContainer parentContainer;

            if (ModelParentMap.TryGetEntityContainer(item, out parentContainer))
            {
                qualifiedPrefix = parentContainer.Name;
            }

            return qualifiedPrefix;
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:14,代码来源:EdmModelValidationContext.cs


注:本文中的System.Data.Entity.Core.Metadata.Edm.EntitySetBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。