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
Afficher le fichier Open project: re-motion/Relinq-SqlBackend Class Usage Examples

Méthodes publiques

Свойство Type Description
SupportedMethods System.Reflection.MethodInfo[]

Méthodes publiques

Méthode Description
Transform ( MethodCallExpression methodCallExpression ) : Expression

Private Methods

Méthode 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 méthode

public Transform ( MethodCallExpression methodCallExpression ) : Expression
methodCallExpression System.Linq.Expressions.MethodCallExpression
Résultat System.Linq.Expressions.Expression

Property Details

SupportedMethods public_oe static_oe property

public static MethodInfo[],System.Reflection SupportedMethods
Résultat System.Reflection.MethodInfo[]