Beispiel #1
0
 private static CreateRecordRequest.IBuilderWithResource PrepareRecords(Dictionary <Enums.ResourceType, string[]> fieldNames)
 {
     return((CreateRecordRequest.IBuilderWithResource)ItemsGenerator(CreateRecordRequest.Builder(), fieldNames,
                                                                     (result, fieldName, fieldValueType, resource) => result.Append(resource.ToPrivateEnum(), content =>
                                                                                                                                    PrepareInitialRecordContent(content, resource.ToPrivateEnum()).Append(fieldName, GetFieldValue(fieldName, fieldValueType)).Build(),
                                                                                                                                    new RecordDescriptor
     {
         FieldName = fieldName,
         FieldValue = fieldValueType,
         Resource = resource
     })));
 }
Beispiel #2
0
 private static CreateRecordRequest.IBuilderWithResource PrepareRecords(Dictionary <Enums.ResourceType, string[]> fieldNames, Func <string, bool, string> valuesProvider = null)
 {
     valuesProvider = valuesProvider ?? GetFieldValue;
     return((CreateRecordRequest.IBuilderWithResource)ItemsGenerator(CreateRecordRequest.Builder(), fieldNames,
                                                                     (result, fieldName, resource) => result
                                                                     .Append(resource.ToPrivateEnum(), content =>
                                                                             PrepareInitialRecordContent(content, resource.ToPrivateEnum()).Append(fieldName, valuesProvider(fieldName, false)).Build(),
                                                                             new RecordDescriptor
     {
         FieldName = fieldName,
         IsPrimary = false,
         Resource = resource
     })
                                                                     .Append(resource.ToPrivateEnum(), content =>
                                                                             PrepareInitialRecordContent(content, resource.ToPrivateEnum()).Append(fieldName, valuesProvider(fieldName, true)).Build(),
                                                                             new RecordDescriptor
     {
         FieldName = fieldName,
         IsPrimary = true,
         Resource = resource
     })));
 }