コード例 #1
0
        public Task <List <TimelineRecord> > UpdateTimelineRecordsAsync(Guid scopeIdentifier, string hubName, Guid planId, Guid timelineId, IEnumerable <TimelineRecord> records, CancellationToken cancellationToken)
        {
            var      recordDictionary = records.ToDictionary(x => x.Id);
            Timeline timeline         = Timelines.GetValueOrDefault(timelineId);

            foreach (var record in timeline.Records)
            {
                if (recordDictionary.ContainsKey(record.Id))
                {
                    MergeTimelineRecords(record, recordDictionary.GetValueOrDefault(record.Id));
                    recordDictionary.Remove(record.Id);
                }
            }
            timeline.Records.AddRange(recordDictionary.Values);
            return(Task.FromResult(records.ToList()));
        }