Skip to content

Commit 86b26be

Browse files
committed
TimeOnly ctors compilers list updated
1 parent f513f5d commit 86b26be

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

Orm/Xtensive.Orm/Orm/Providers/Expressions/MemberCompilers/TimeOnlyCompilers.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the License.txt file in the project root for more information.
44

55
using System;
6+
using Xtensive.Reflection;
67
using Xtensive.Sql;
78
using Xtensive.Sql.Dml;
89
using Operator = Xtensive.Reflection.WellKnown.Operator;
@@ -43,6 +44,13 @@ public static SqlExpression TimeOnlyTicks(SqlExpression _this)
4344
#endregion
4445

4546
#region Constructors
47+
[Compiler(typeof(TimeOnly), null, TargetKind.Constructor)]
48+
public static SqlExpression TimeOnlyCtor(
49+
[Type(typeof(int))] SqlExpression hour,
50+
[Type(typeof(int))] SqlExpression minute,
51+
[Type(typeof(int))] SqlExpression second,
52+
[Type(typeof(int))] SqlExpression millisecond) =>
53+
SqlDml.TimeConstruct(hour, minute, second, millisecond);
4654

4755
[Compiler(typeof(TimeOnly), null, TargetKind.Constructor)]
4856
public static SqlExpression TimeOnlyCtor(
@@ -57,9 +65,9 @@ public static SqlExpression TimeOnlyCtor(
5765
[Type(typeof(int))] SqlExpression minute) =>
5866
SqlDml.TimeConstruct(hour, minute, 0, 0);
5967

60-
[Compiler(typeof(TimeOnly), null, TargetKind.Constructor)]
61-
public static SqlExpression TimeOnlyCtor([Type(typeof(long))] SqlExpression ticks) =>
62-
new SqlFunctionCall(SqlFunctionType.TimeConstruct, ticks);
68+
//[Compiler(typeof(TimeOnly), null, TargetKind.Constructor)]
69+
//public static SqlExpression TimeOnlyCtor([Type(typeof(long))] SqlExpression ticks) =>
70+
// new SqlFunctionCall(SqlFunctionType.TimeConstruct, ticks);
6371

6472
#endregion
6573

@@ -123,10 +131,6 @@ public static SqlExpression TimeOnlyOperatorSubtraction(
123131

124132
#endregion
125133

126-
[Compiler(typeof(TimeOnly), "Add")]
127-
public static SqlExpression TimeOnlyAdd(SqlExpression _this, [Type(typeof(TimeSpan))] SqlExpression value) =>
128-
throw new NotImplementedException();
129-
130134
[Compiler(typeof(TimeOnly), "AddHours")]
131135
public static SqlExpression TimeOnlyAddHours(SqlExpression _this, [Type(typeof(double))] SqlExpression value) =>
132136
SqlDml.TimeAddHours(_this, value);
@@ -145,7 +149,6 @@ public static SqlExpression TimeOnlyToStringIso(SqlExpression _this)
145149
public static SqlExpression TimeOnlyToStringIso(SqlExpression _this, [Type(typeof(string))] SqlExpression value)
146150
{
147151
throw new NotImplementedException();
148-
149152
//var stringValue = value as SqlLiteral<string>;
150153

151154
//if (stringValue == null)

0 commit comments

Comments
 (0)