Пример #1
0
 private void VerifyUdfSerDe(Delegate expectedUdf, Delegate actualUdf, bool hasClosure)
 {
     VerifyUdfData(
         UdfSerDe.Serialize(expectedUdf),
         UdfSerDe.Serialize(actualUdf),
         hasClosure);
     VerifyDelegate(expectedUdf, actualUdf);
 }
Пример #2
0
        private byte[] Serialize(Delegate udf)
        {
            UdfSerDe.UdfData udfData = UdfSerDe.Serialize(udf);

            using (var ms = new MemoryStream())
            {
                var bf = new BinaryFormatter();
                bf.Serialize(ms, udfData);
                return(ms.ToArray());
            }
        }