public static void SyncList(Guid listId)
        {
            var configProvider = new AppConfigService();
            var mappingSetting = configProvider.GetMappingByList(listId.ToString());

            if (mappingSetting == null)
            {
                return;
            }
            var dataProvider = new AppDataService();
            {
                var list      = SPContext.Current.SPList(listId);
                var listitems = list.ListItems(mappingSetting.Key,
                                               String.Join("$", mappingSetting.ListMappingFields.Select(item => item.ItemName).ToList()), true);

                dataProvider.SaveRows(mappingSetting, listitems);
            }
        }
 public override void ItemDeleting(SPItemEventProperties properties)
 {
     base.ItemDeleting(properties);
     try
     {
         var configProvider = new AppConfigService(properties.Web);
         var mappingSetting = configProvider.GetMappingByList(properties.ListId.ToString());
         if (mappingSetting == null)
         {
             return;
         }
         var dataProvider = new AppDataService(properties.Web);
         {
             dataProvider.Delete(mappingSetting.TableName, mappingSetting.Key, properties.ListItemId);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Instance.ErrorULS("ItemDeleting error", ex);
     }
 }
 public override void ItemUpdated(SPItemEventProperties properties)
 {
     base.ItemUpdated(properties);
     try
     {
         var configProvider = new AppConfigService(properties.Web);
         var mappingSetting = configProvider.GetMappingByList(properties.ListId.ToString());
         if (mappingSetting == null)
         {
             return;
         }
         var dataProvider = new AppDataService(properties.Web);
         {
             dataProvider.SaveRow(mappingSetting, properties.ListItem.ToSyncObject(mappingSetting));
         }
     }
     catch (Exception ex)
     {
         LogHelper.Instance.ErrorULS("ItemUpdated error", ex);
     }
 }