本文整理汇总了C#中EntityCollection.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# EntityCollection.RemoveAt方法的具体用法?C# EntityCollection.RemoveAt怎么用?C# EntityCollection.RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityCollection
的用法示例。
在下文中一共展示了EntityCollection.RemoveAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetTransaction
private EntityCollection SetTransaction(EntityCollection entityCollection, WeeklySummaryCollection weeklySummaryCollection)
{
for (int i = 0; i < entityCollection.Count; i++)
{
if (entityCollection[i].SumType == SumType.Transaction)
{
entityCollection[i].SubEntities = SetSubtotal(entityCollection[i].SubEntities, weeklySummaryCollection);
WeeklySummaryCollection _weeklySummaryCollection = CalculateService.Instance.GetWeeklySummary(entityCollection[i].EntityID);
if (_weeklySummaryCollection.Count == 0)
{
WeeklySummary _weeklySummary = new WeeklySummary(PeriodService.Instance.GetCurrentPeriod()[0], entityCollection[i]);
using (WeeklySummaryAccessClient _weeklySummaryAccessClient = new WeeklySummaryAccessClient(EndpointName.WeeklySummaryAccess))
{
_weeklySummaryAccessClient.Insert1(_weeklySummary);
}
weeklySummaryCollection.Add(_weeklySummary);
}
else
{
weeklySummaryCollection.AddRange(_weeklySummaryCollection);
}
continue;
}
EntityCollection _subEntities = entityCollection[i].SubEntities;
entityCollection.RemoveAt(i);
if (_subEntities.Count > 0)
{
entityCollection.InsertRange(i, _subEntities);
}
i--;
}
return entityCollection;
}
示例2: SetLastLevel
private EntityCollection SetLastLevel(EntityCollection entityCollection, WeeklySummaryCollection weeklySummaryCollection)
{
for (int i = 0; i < entityCollection.Count; i++)
{
if (entityCollection[i].IsLastLevel == 1)
{
WeeklySummaryCollection _weeklySummaryCollection = CalculateService.Instance.GetWeeklySummary(entityCollection[i].EntityID);
if (_weeklySummaryCollection.Count == 0)
{
entityCollection.RemoveAt(i--);
}
else
{
weeklySummaryCollection.AddRange(_weeklySummaryCollection);
}
continue;
}
EntityCollection _subEntities = entityCollection[i].SubEntities;
entityCollection.RemoveAt(i);
if (_subEntities.Count > 0)
{
entityCollection.InsertRange(i, _subEntities);
}
i--;
}
return entityCollection;
}