Пример #1
0
 // Used for converting an arbitrary .net enumerable.
 // The types of the elements my be heterogenous even after this call
 private static IEnumerable <RecordValue> TableToRecords(
     System.Collections.IEnumerable values,
     Type elementType)
 {
     foreach (var obj in values)
     {
         var formulaValue = GuaranteeRecord(FormulaValue.New(obj, elementType));
         yield return(formulaValue);
     }
 }
Пример #2
0
        public static TableValue TableFromRecords <T>(IEnumerable <T> values, TableType type)
        {
            var values2 = values.Select(v => GuaranteeRecord(FormulaValue.New(v, typeof(T))));

            return(new InMemoryTableValue(IRContext.NotInSource(type), values2.Select(r => DValue <RecordValue> .Of(r))));
        }