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


C# EntityCollection.Select方法代码示例

本文整理汇总了C#中EntityCollection.Select方法的典型用法代码示例。如果您正苦于以下问题:C# EntityCollection.Select方法的具体用法?C# EntityCollection.Select怎么用?C# EntityCollection.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EntityCollection的用法示例。


在下文中一共展示了EntityCollection.Select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompositeEntitySchema

        public CompositeEntitySchema(EntitySchema schema, IEnumerable<EntitySchema> ancestorSchemas, bool copyRelationProxiesFromSchema = false)
            : base(schema.Alias, schema.Name)
        {
            //TODO: Need to move this into a mapper, but not currently one available at the right level
            Id = schema.Id;
            SchemaType = SchemaType;
            AttributeGroups.AddRange(schema.AttributeGroups);
            AttributeDefinitions.AddRange(schema.AttributeDefinitions);
            UtcCreated = schema.UtcCreated;
            UtcModified = schema.UtcModified;
            UtcStatusChanged = schema.UtcStatusChanged;

            var inheritedDefsDict = new Dictionary<string, InheritedAttributeDefinition>();
            var inheritedDefs = ancestorSchemas
                .SelectMany(entitySchema => entitySchema.AttributeDefinitions.Select(definition => new InheritedAttributeDefinition(definition, entitySchema))).ToArray();
            foreach (var def in inheritedDefs)
            {
                if (!inheritedDefsDict.ContainsKey(def.Alias))
                    inheritedDefsDict.Add(def.Alias, def);
            }

            InheritedAttributeDefinitions = new EntityCollection<InheritedAttributeDefinition>(inheritedDefsDict.Values);

            // Need to only show the inherited groups that are exposed by the filtered inherited attribute definitions, but also include empty
            // groups so that they have a chance to have some definitions added
            var allLinkedGroups = ancestorSchemas.SelectMany(x => x.AttributeDefinitions.Select(y => new InheritedAttributeGroup(y.AttributeGroup, x)));
            var allKnownGroups = ancestorSchemas.SelectMany(x => x.AttributeGroups.Select(y => new InheritedAttributeGroup(y, x)));
            var unlinkedGroups = allKnownGroups.Except(allLinkedGroups);

            var inheritedGroups =
                InheritedAttributeDefinitions.Select(x => new InheritedAttributeGroup(x.AttributeGroup, x.Schema)).Union
                    (unlinkedGroups);

            InheritedAttributeGroups = new EntityCollection<InheritedAttributeGroup>(inheritedGroups);

            RelationProxies.LazyLoadDelegate = schema.RelationProxies.LazyLoadDelegate;
            XmlConfiguration = schema.XmlConfiguration;

            if (copyRelationProxiesFromSchema)
            {
                foreach (var proxies in schema.RelationProxies.GetManualParentProxies())
                {
                    RelationProxies.EnlistParent(proxies.Item.Source, proxies.Item.Type, proxies.Item.Ordinal, proxies.Item.MetaData.ToArray());
                }
                foreach (var proxies in schema.RelationProxies.GetManualChildProxies())
                {
                    RelationProxies.EnlistParent(proxies.Item.Source, proxies.Item.Type, proxies.Item.Ordinal, proxies.Item.MetaData.ToArray());
                }
            }
        }
开发者ID:paulsuart,项目名称:rebelcmsxu5,代码行数:50,代码来源:CompositeEntitySchema.cs

示例2: CreatePOITagsSubmenu

 private static List<CMSMenuItem> CreatePOITagsSubmenu(EntityCollection<tbl_POITags> tags)
 {
     return tags.Select(tag => new CMSMenuItem
      {
          MenuItemID = tag.POITagID,
          Title = tag.POIT_Title,
      }).ToList();
 }
开发者ID:nhtera,项目名称:CrowdCMS,代码行数:8,代码来源:LeftMenuModelMapper.cs

示例3: LoadProject

 public void LoadProject()
 {
     personsDataGrid.IsEnabled = true;
     EntityCollection<Person> t_Persons = new EntityCollection<Person>();
     var t = projectsListBox.SelectedItem; ProjectId = ((Project)t).Id; t_Persons = (EntityCollection<Person>)t.GetType().GetProperty("Persons").GetValue(t, null);
     var persons = t_Persons.Select(o => new { Id = o.Id, Фамилия = o.Surname, Имя = o.Name, Отчество = o.Patronymic });
     personsDataGrid.ItemsSource = persons.ToList();
     
     LoadColumns();
     personsTab.Visibility = System.Windows.Visibility.Visible;
     materialsTab.Visibility = System.Windows.Visibility.Visible;
     eventsTab.Visibility = System.Windows.Visibility.Visible;
     tabControl1.SelectedIndex = 1;
 }
开发者ID:vandalism0x,项目名称:FamilyTree,代码行数:14,代码来源:MainWindow.xaml.cs


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