本文整理汇总了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());
}
}
}
示例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();
}
示例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;
}