- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
var ChildListWithCondition =
(from list in ChildList
join requestedRelatedEntityIds in EntitiesIdInList on list.ParentEntityId equals requestedRelatedEntityIds
join requestedEntityType in EntityTypeIdToTake on list.EntityTypeId equals requestedEntityType)
.Select(list =>
new LayoutDataOutputStructure()
{
ParentEntityId = list.ParentEntityId,
EntityId = list.EntityId,
FieldId = list.FieldId,
FieldValue = list.FieldValue,
EntityTypeId = list.EntityTypeId,
RelationTypeToParent = list.RelationTypeToParent,
FieldValueId = list.FieldValueId
})
.GroupBy(item => item.ParentEntityId)
.Select(group => new
{
ParentEntityId = group.Key,
GroupEntityTypeId = group.GroupBy(item => item.EntityTypeId)
.Select(group2 => new
{
EntityTypeId = group2.Key,
EntityRelation = group2.Select(item => item.RelationTypeToParent).FirstOrDefault(),
GroupEntityId = group2.GroupBy(group3 => group3.EntityId)
.Select(group3 => new
{
EntityId = group3.Key,
Fields = group3.GroupBy(group4 => group4.FieldId)
.Select(group4 => new { FieldId = group4.Key, FieldValues = group4 })
})
}
)
}
)
.ToList();
guest 29.12.2009 18:26 # 0
Чтобы все всё сразу поняли.
explosion_head 29.12.2009 18:37 # +3
guest 06.01.2010 18:26 # 0
workgss 29.12.2009 19:17 # 0
Кстати ниже были еще методы сериализации и десериализации этих данных вручную. Тут места не хватит чтобы это запостить)))
explosion_head 30.12.2009 01:00 # +4
guest 30.12.2009 11:29 # 0
void IFileSystem.TransferFile(string from, string to, bool move)
{
var begin = move
? Lambda.Func(() => m_Watcher.OnFileRenaming(from, to))
: Lambda.Func(() => m_Watcher.OnFileCreating(to));
var end = move
? Lambda.Action(() => m_Watcher.OnFileRenamed(from, to))
: Lambda.Action(() => m_Watcher.OnFileCreated(to));
if (begin())
{
var customData = default(Dictionary<string, object>);
if (!String.IsNullOrEmpty(from))
{
FileRecord record;
customData = m_Data.Files.TryGetItem(from, out record) ? record.CustomData : null;
if (move && record != null) // if "record == null", that file not found
{
RemoveFileFromProject(from);
}//if
}//if
if (!String.IsNullOrEmpty(to) && !IsProjectFile(to))
{
AddFileToProject(to, customData);
}//if
end();
}//if
}
TarasB 31.12.2009 14:45 # 0
slesar_kip 25.08.2021 19:34 # 0