Skip to content

Commit

Permalink
Refactor: Add explicit typemapping, fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
nmichels committed Dec 10, 2019
1 parent 241926b commit a77d3d5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 777 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
Expand All @@ -22,9 +24,10 @@ public virtual SqlExpression Translate(SqlExpression instance, MethodInfo method
{
return _methodInfo.Equals(method)
? _sqlExpressionFactory.Function(
"DATETIMEFROMPARTS",
new[] { arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7] },
_methodInfo.ReturnType)
"DATETIMEFROMPARTS",
arguments.Skip(1),
_methodInfo.ReturnType,
_sqlExpressionFactory.FindMapping(typeof(DateTime)))
: null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public SqlServerMethodCallTranslatorProvider([NotNull] RelationalMethodCallTrans
: base(dependencies)
{
var sqlExpressionFactory = dependencies.SqlExpressionFactory;

AddTranslators(
new IMethodCallTranslator[]
{
Expand Down
Loading

0 comments on commit a77d3d5

Please sign in to comment.