C# Класс 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.

Наследование: IMethodCallTransformer
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
SupportedMethods System.Reflection.MethodInfo[]

Открытые методы

Метод Описание
Transform ( MethodCallExpression methodCallExpression ) : Expression

Приватные методы

Метод Описание
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

Описание методов

Transform() публичный Метод

public Transform ( MethodCallExpression methodCallExpression ) : Expression
methodCallExpression System.Linq.Expressions.MethodCallExpression
Результат System.Linq.Expressions.Expression

Описание свойств

SupportedMethods публичное статическое свойство

public static MethodInfo[],System.Reflection SupportedMethods
Результат System.Reflection.MethodInfo[]