From 2a9ecc70e2043bcfb7f2db87f9ac720b481f10fe Mon Sep 17 00:00:00 2001 From: jbevain Date: Thu, 3 Sep 2009 12:10:09 +0000 Subject: [PATCH] 2009-09-03 Jb Evain * ConstantExpression.cs (Emit): add support to emit DBNull values. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@141241 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/System.Core/System.Linq.Expressions/ChangeLog | 4 ++++ class/System.Core/System.Linq.Expressions/ConstantExpression.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/class/System.Core/System.Linq.Expressions/ChangeLog b/class/System.Core/System.Linq.Expressions/ChangeLog index 55387ee3ca..6025efa119 100644 --- a/class/System.Core/System.Linq.Expressions/ChangeLog +++ b/class/System.Core/System.Linq.Expressions/ChangeLog @@ -1,5 +1,9 @@ 2009-09-03 Jb Evain + * ConstantExpression.cs (Emit): add support to emit DBNull values. + +2009-09-03 Jb Evain + * ConstantExpression.cs (Emit): add support for emitting DateTime constants. diff --git a/class/System.Core/System.Linq.Expressions/ConstantExpression.cs b/class/System.Core/System.Linq.Expressions/ConstantExpression.cs index f59a05d6b6..0bf985cbb4 100644 --- a/class/System.Core/System.Linq.Expressions/ConstantExpression.cs +++ b/class/System.Core/System.Linq.Expressions/ConstantExpression.cs @@ -144,6 +144,10 @@ namespace System.Linq.Expressions { return; } + case TypeCode.DBNull: + ig.Emit (OpCodes.Ldsfld, typeof (DBNull).GetField ("Value", BindingFlags.Public | BindingFlags.Static)); + return; + case TypeCode.String: EmitIfNotNull (ec, c => c.ig.Emit (OpCodes.Ldstr, (string) value)); return; -- 2.11.4.GIT