コード例 #1
0
 private static DataMap MergeWithPrefilledValues(DataMap schemaDefaultValues, Entity initialValues)
 {
     foreach (var attribute in initialValues.Attributes.Where(f => f.Value != null))
     {
         var key = attribute.Key;
         if (schemaDefaultValues.ContainsAttribute(key))
         {
             schemaDefaultValues.Attributes.Remove(key);
         }
         schemaDefaultValues.Attributes.Add(key, attribute.Value.ToString());
     }
     foreach (var attribute in initialValues.UnmappedAttributes.Where(f => f.Value != null))
     {
         var key = attribute.Key;
         if (schemaDefaultValues.ContainsAttribute(key))
         {
             schemaDefaultValues.Attributes.Remove(key);
         }
         schemaDefaultValues.Attributes.Add(key, attribute.Value.ToString());
     }
     return(schemaDefaultValues);
 }