Exemplo n.º 1
0
 public static void AddField <ResultType, InputType>(this Records.Records Records, System.String ResultFieldName, System.String InputFieldName, System.Func <InputType, InputType, ResultType> Action)
 {
     if (Records.Count > 0)
     {
         Records.First.Add(ResultFieldName, default(ResultType));
         Records.Map((Record1, Record2) => Record2.Add(ResultFieldName, Action(Record1.Get <InputType>(InputFieldName), Record2.Get <InputType>(InputFieldName))));
     }
 }
Exemplo n.º 2
0
 public static AggregateType Aggregate <AggregateType>(this Records.Records Records, System.String InputFileName, System.Func <AggregateType, AggregateType, AggregateType> Aggregator)
 {
     if (Records.Count > 0)
     {
         return(Records.Fold(Records.First.Get <AggregateType>(InputFileName), (Value, Record) => Aggregator(Value, Record.Get <AggregateType>(InputFileName))));
     }
     else
     {
         throw new System.InvalidOperationException();
     }
 }
Exemplo n.º 3
0
 public static void UpdateFieldOfFirstOfPair <OutputType, InputType1, InputType2>(this Records.Records Records, System.String OutputFieldName, System.String InputFieldName1, System.String InputFieldName2, System.Func <InputType1, InputType2, OutputType> Action)
 {
     Records.Map((One, Two) => One.Update(OutputFieldName, Action(One.Get <InputType1>(InputFieldName1), Two.Get <InputType2>(InputFieldName2))));
 }
Exemplo n.º 4
0
 public static void AddField <ResultType, InputType>(this Records.Records Records, System.String ResultFieldName, System.String InputFieldName, System.Func <InputType, ResultType> Action)
 {
     Records.Map(Record => Record.Add(ResultFieldName, Action(Record.Get <InputType>(InputFieldName))));
 }
Exemplo n.º 5
0
 public static void AddField <Type>(this Records.Records Records, System.String FieldName, Type FieldValue)
 {
     Records.Map(Record => Record.Add(FieldName, FieldValue));
 }
Exemplo n.º 6
0
 public static void UpdateFieldOfSecondOfPair <OutputType, InputType>(this Records.Records Records, System.String OutputFieldName, System.String InputFieldName, System.Func <InputType, InputType, OutputType> Action)
 {
     Records.Map((One, Two) => Two.Update(OutputFieldName, Action(One.Get <InputType>(InputFieldName), Two.Get <InputType>(InputFieldName))));
 }
Exemplo n.º 7
0
 public static void UpdateField <FieldType>(this Records.Records Records, System.String FieldName, System.Func <FieldType, FieldType> Action)
 {
     Records.Map(Record => Record.Update(FieldName, Action(Record.Get <FieldType>(FieldName))));
 }