C# Class Remotion.Linq.SqlBackend.SqlPreparation.MethodCallTransformers.DateTimeAddMethodCallTransformer

Implements the IMethodCallTransformer interface for the DateTime.Add(TimeSpan) family of methods.

Calls to those methods are represented as calls to the DATEADD SQL function. For DateTime.AddYears and DateTime.AddMonths, we use DATEADD (year, ...) and DATEADD (month, ...) respectively. For the other methods, we convert the given number to whole milliseconds and call DATEADD (millisecond, ...). (Converting to milliseconds directly corresponds to the in-memory behavior. E.g., AddDays (12.5) always adss 12.5 * 24 hours, not respecting DST changes or something like this.)

DateTime.Add only supports constant values, all the other methods also support column values.

Inheritance: IMethodCallTransformer
Datei anzeigen Open project: re-motion/Relinq-SqlBackend Class Usage Examples

Public Properties

Property Type Description
SupportedMethods System.Reflection.MethodInfo[]

Public Methods

Method Description
Transform ( MethodCallExpression methodCallExpression ) : Expression

Private Methods

Method Description
AddMilliseconds ( Expression milliseconds, Expression dateTime ) : Expression
AddTicks ( Expression ticks, Expression dateTime ) : Expression
AddTimeSpan ( System.TimeSpan timeSpan, Expression dateTime ) : Expression
AddUnits ( Expression value, string unit, Expression dateTime ) : Expression
AddWithConversion ( Expression value, double factorToMilliseconds, Expression dateTime ) : Expression

Method Details

Transform() public method

public Transform ( MethodCallExpression methodCallExpression ) : Expression
methodCallExpression System.Linq.Expressions.MethodCallExpression
return System.Linq.Expressions.Expression

Property Details

SupportedMethods public_oe static_oe property

public static MethodInfo[],System.Reflection SupportedMethods
return System.Reflection.MethodInfo[]