Beispiel #1
0
        public static List <EventConferenceTrackRecord> UpdateEventConferenceTracks(
            IList <string> importConferenceTracks,
            IEventConferenceTrackService service
            )
        {
            var eventConferenceTrackRecords = service.FindAllAsync().Result;

            var patch = new PatchDefinition <string, EventConferenceTrackRecord>(
                (source, list) => list.SingleOrDefault(a => a.Name == source)
                );

            patch.Map(s => s, t => t.Name);
            var diff = patch.Patch(importConferenceTracks, eventConferenceTrackRecords);

            service.ApplyPatchOperationAsync(diff).Wait();

            return(diff.Where(a => a.Entity.IsDeleted == 0).Select(a => a.Entity).ToList());
        }
        private List <EventConferenceTrackRecord> UpdateEventConferenceTracks(
            IList <string> importConferenceTracks,
            ref int modifiedRecords
            )
        {
            var eventConferenceTrackRecords = _eventConferenceTrackService.FindAllAsync().Result;

            var patch = new PatchDefinition <string, EventConferenceTrackRecord>(
                (source, list) => list.SingleOrDefault(a => a.Name == source)
                );

            patch.Map(s => s, t => t.Name);
            var diff = patch.Patch(importConferenceTracks, eventConferenceTrackRecords);

            _eventConferenceTrackService.ApplyPatchOperationAsync(diff).Wait();

            modifiedRecords += diff.Count(a => a.Action != ActionEnum.NotModified);
            return(diff.Where(a => a.Entity.IsDeleted == 0).Select(a => a.Entity).ToList());
        }
 public Task <IEnumerable <EventConferenceTrackRecord> > GetEventsAsync()
 {
     return(_eventConferenceTrackService.FindAllAsync());
 }