@@ -25,7 +25,7 @@ static void Main(string[] args) {
2525 //var i = 5;
2626 //Expression<Func<int, int>> expr = j => (i + j + 17) * (i + j + 17);
2727
28- // Expression<Func<bool>> expr = () => true;
28+ Expression < Func < bool > > expr = ( ) => true ;
2929
3030 //Expression<Func<string, int, string>> expr = (s, i) => $"{s}, {i}";
3131
@@ -263,35 +263,37 @@ static void Main(string[] args) {
263263
264264 //Expression<Func<string>> expr = () => string.IsInterned("");
265265
266- var personSource = new List < Person > ( ) . AsQueryable ( ) ;
267- var qry = personSource . Where ( x => x . LastName . StartsWith ( "D" ) ) ;
268- var expr = qry . GetType ( ) . GetProperty ( "Expression" , NonPublic | Instance ) . GetValue ( qry ) ;
266+ //var personSource = new List<Person>().AsQueryable();
267+ //var qry = personSource.Where(x => x.LastName.StartsWith("D"));
268+ //var expr = qry.GetType().GetProperty("Expression", NonPublic | Instance).GetValue(qry);
269+
270+ //Expression<Func<Person, bool>> expr = p => p.DOB.DayOfWeek == DayOfWeek.Tuesday;
269271
270272 var visualizerHost = new VisualizerDevelopmentHost ( expr , typeof ( Visualizer ) , typeof ( VisualizerDataObjectSource ) ) ;
271273 visualizerHost . ShowVisualizer ( ) ;
272274
273275 //Console.ReadKey(true);
274276
275- var stream = System . IO . File . Create ( System . IO . Path . GetTempFileName ( ) ) ;
276- var formatter = new System . Runtime . Serialization . Formatters . Binary . BinaryFormatter ( ) ;
277-
278- var data = new VisualizerData ( expr ) ;
279- var t = typeof ( VisualizerData ) ;
280- foreach ( var prp in t . GetProperties ( ) ) {
281- try {
282- formatter . Serialize ( stream , prp . GetValue ( data ) ) ;
283- } catch ( Exception ) {
284- Console . WriteLine ( $ "Serialization failed on property { prp . Name } ") ;
285- }
286- }
287-
288- foreach ( var fld in t . GetFields ( ) ) {
289- try {
290- formatter . Serialize ( stream , fld . GetValue ( data ) ) ;
291- } catch ( Exception ) {
292- Console . WriteLine ( $ "Serialization failed on field { fld . Name } ") ;
293- }
294- }
277+ // var stream = System.IO.File.Create(System.IO.Path.GetTempFileName());
278+ // var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
279+
280+ // var data = new VisualizerData(expr);
281+ // var t = typeof(VisualizerData);
282+ // foreach (var prp in t.GetProperties()) {
283+ // try {
284+ // formatter.Serialize(stream, prp.GetValue(data));
285+ // } catch (Exception) {
286+ // Console.WriteLine($"Serialization failed on property {prp.Name}");
287+ // }
288+ // }
289+
290+ // foreach (var fld in t.GetFields()) {
291+ // try {
292+ // formatter.Serialize(stream, fld.GetValue(data));
293+ // } catch (Exception) {
294+ // Console.WriteLine($"Serialization failed on field {fld.Name}");
295+ // }
296+ // }
295297 }
296298
297299 static Expression < Func < int , int > > expr1 = ( ( Func < Expression < Func < int , int > > > ) ( ( ) => {
0 commit comments