public static WitMappingIndex CreateEmpty(string pathToDataFile)
        {
            var mapping = new WitMappingIndex();

            mapping.Save(pathToDataFile);
            return(mapping);
        }
Beispiel #2
0
 private void UpdateIndex(WitMappingIndex index, IEnumerable <WorkItem> updatedWorkItems, WorkItemsStageConfiguration mapping)
 {
     if (mapping.HasIndex)
     {
         index.Update(updatedWorkItems);
         index.Save(mapping.IndexFile);
     }
     else
     {
         foreach (var dst in updatedWorkItems)
         {
             var originatingFieldMap = mapping.FindIdFieldForTargetWorkItemType(dst.Type.Name);
             int originatingId       = (int)dst.Fields[originatingFieldMap.Destination].Value;
             index.Update(originatingId, dst);
         }//for
     }
 }