@@ -19,27 +19,27 @@ internal static class DateOnlyCompilers
1919
2020 [ Compiler ( typeof ( DateOnly ) , "Year" , TargetKind . PropertyGet ) ]
2121 public static SqlExpression DateOnlyYear ( SqlExpression _this ) =>
22- ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDateTimePart . Year , _this ) ) ;
22+ ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDatePart . Year , _this ) ) ;
2323
2424 [ Compiler ( typeof ( DateOnly ) , "Month" , TargetKind . PropertyGet ) ]
2525 public static SqlExpression DateOnlyMonth ( SqlExpression _this ) =>
26- ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDateTimePart . Month , _this ) ) ;
26+ ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDatePart . Month , _this ) ) ;
2727
2828 [ Compiler ( typeof ( DateOnly ) , "Day" , TargetKind . PropertyGet ) ]
2929 public static SqlExpression DateOnlyDay ( SqlExpression _this ) =>
30- ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDateTimePart . Day , _this ) ) ;
30+ ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDatePart . Day , _this ) ) ;
3131
3232
3333 [ Compiler ( typeof ( DateOnly ) , "DayOfYear" , TargetKind . PropertyGet ) ]
3434 public static SqlExpression DateOnlyDayOfYear ( SqlExpression _this )
3535 {
36- return ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDateTimePart . DayOfYear , _this ) ) ;
36+ return ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDatePart . DayOfYear , _this ) ) ;
3737 }
3838
3939 [ Compiler ( typeof ( DateOnly ) , "DayOfWeek" , TargetKind . PropertyGet ) ]
4040 public static SqlExpression DateOnlyDayOfWeek ( SqlExpression _this )
4141 {
42- var baseExpression = ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDateTimePart . DayOfWeek , _this ) ) ;
42+ var baseExpression = ExpressionTranslationHelpers . ToInt ( SqlDml . Extract ( SqlDatePart . DayOfWeek , _this ) ) ;
4343 var context = ExpressionTranslationContext . Current ;
4444 if ( context == null ) {
4545 return baseExpression ;
@@ -137,15 +137,15 @@ public static SqlExpression DateOnlyToStringIso(SqlExpression _this)
137137 public static SqlExpression DateOnlyToStringIso ( SqlExpression _this , [ Type ( typeof ( string ) ) ] SqlExpression value )
138138 {
139139 throw new NotImplementedException ( ) ;
140- // var stringValue = value as SqlLiteral<string>;
140+ var stringValue = value as SqlLiteral < string > ;
141141
142- // if (stringValue == null)
143- // throw new NotSupportedException(Strings.ExTranslationOfDateTimeToStringWithArbitraryArgumentsIsNotSupported);
142+ if ( stringValue == null )
143+ throw new NotSupportedException ( Strings . ExTranslationOfDateTimeToStringWithArbitraryArgumentsIsNotSupported ) ;
144144
145- // if (!stringValue.Value.Equals("s"))
146- // throw new NotSupportedException(Strings.ExTranslationOfDateTimeToStringWithArbitraryArgumentsIsNotSupported);
145+ if ( ! stringValue . Value . Equals ( "s" ) )
146+ throw new NotSupportedException ( Strings . ExTranslationOfDateTimeToStringWithArbitraryArgumentsIsNotSupported ) ;
147147
148- // return SqlDml.DateTimeToStringIso(_this);
148+ return SqlDml . DateTimeToStringIso ( _this ) ;
149149 }
150150 }
151151#endif
0 commit comments