示例#1
0
        protected void ProcessSyncResult(SyncResult syncResult)
        {
            ProcessBaseResult(syncResult);
            var standardSyncData = SyncData <Standard, Guid> .Create(syncResult.StandardSyncItems, syncResult.Standards);

            ServiceLocator.StandardService.Add(standardSyncData.Insert?.Select(MapperHelper.Map).ToList());
            ServiceLocator.StandardService.Edit(standardSyncData.Update?.Select(MapperHelper.Map).ToList());
            ServiceLocator.StandardService.Delete(standardSyncData.Delete);
            Log.LogInfo("Processed Standard table");

            var topicSyncData = SyncData <Topic, Guid> .Create(syncResult.TopicSyncItems, syncResult.Topics);

            ServiceLocator.TopicService.Add(topicSyncData.Insert?.Select(MapperHelper.Map).ToList());
            ServiceLocator.TopicService.Edit(topicSyncData.Update?.Select(MapperHelper.Map).ToList());
            ServiceLocator.TopicService.Delete(topicSyncData.Delete);
            Log.LogInfo("Processed Topic table");
        }