Skip to content

Commit

Permalink
Merge branch 'release/8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers committed Sep 17, 2023
2 parents b3ec007 + b7f8860 commit 21b6191
Show file tree
Hide file tree
Showing 9 changed files with 34,332 additions and 18,061 deletions.
34 changes: 28 additions & 6 deletions src/EFCore.Design/Query/Internal/LinqToCSharpSyntaxTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,13 @@ protected override Expression VisitMethodCall(MethodCallExpression call)
methodIdentifier),
ArgumentList(SeparatedList(arguments[1..])));
}
else if (call.Method is { Name: "op_Equality", IsHideBySig: true, IsSpecialName: true })
{
Result = BinaryExpression(
SyntaxKind.EqualsExpression,
Translate<ExpressionSyntax>(call.Arguments[0]),
Translate<ExpressionSyntax>(call.Arguments[1]));
}
else
{
ExpressionSyntax expression;
Expand All @@ -1440,12 +1447,23 @@ ExpressionSyntax GetMemberAccessesForAllDeclaringTypes(Type type)
expression = Translate<ExpressionSyntax>(call.Object);
}

Result = InvocationExpression(
MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
if (call.Method.Name.StartsWith("get_", StringComparison.Ordinal)
&& call.Method.GetParameters().Length == 1
&& call.Method is { IsHideBySig: true, IsSpecialName: true })
{
Result = ElementAccessExpression(
expression,
methodIdentifier),
ArgumentList(SeparatedList(arguments)));
BracketedArgumentList(SeparatedList(arguments)));
}
else
{
Result = InvocationExpression(
MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
expression,
methodIdentifier),
ArgumentList(SeparatedList(arguments)));
}
}

if (call.Method.DeclaringType.Namespace is { } ns)
Expand Down Expand Up @@ -1904,7 +1922,11 @@ protected override Expression VisitTypeBinary(TypeBinaryExpression node)
/// <inheritdoc />
protected override Expression VisitUnary(UnaryExpression unary)
{
if (unary.Method is not null)
if (unary.Method is not null
&& !unary.Method.IsHideBySig
&& !unary.Method.IsSpecialName
&& unary.Method.Name != "op_Implicit"
&& unary.Method.Name != "op_Explicit")
{
throw new NotImplementedException("Unary node with non-null method");
}
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/Storage/ByteTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ByteTypeMapping : RelationalTypeMapping
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static ByteArrayTypeMapping Default { get; } = new("tinyint");
public static ByteTypeMapping Default { get; } = new("tinyint");

/// <summary>
/// Initializes a new instance of the <see cref="ByteTypeMapping" /> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SqliteGuidTypeMapping : GuidTypeMapping
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static new readonly SqliteGuidTypeMapping Default = new(SqliteTypeMappingSource.TextTypeName);
public static new SqliteGuidTypeMapping Default { get; } = new(SqliteTypeMappingSource.TextTypeName);

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private static readonly ConstructorInfo MemoryStreamConstructor
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static readonly SqliteJsonTypeMapping Default = new(SqliteTypeMappingSource.TextTypeName);
public static SqliteJsonTypeMapping Default { get; } = new(SqliteTypeMappingSource.TextTypeName);

/// <summary>
/// Initializes a new instance of the <see cref="SqliteJsonTypeMapping" /> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SqliteStringTypeMapping : StringTypeMapping
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static new readonly SqliteStringTypeMapping Default = new(SqliteTypeMappingSource.TextTypeName);
public static new SqliteStringTypeMapping Default { get; } = new(SqliteTypeMappingSource.TextTypeName);

/// <summary>
/// Initializes a new instance of the <see cref="SqliteStringTypeMapping" /> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SqliteTimeOnlyTypeMapping : TimeOnlyTypeMapping
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static new readonly SqliteTimeOnlyTypeMapping Default = new(SqliteTypeMappingSource.TextTypeName);
public static new SqliteTimeOnlyTypeMapping Default { get; } = new(SqliteTypeMappingSource.TextTypeName);

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SqliteULongTypeMapping : ULongTypeMapping
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public static new readonly SqliteULongTypeMapping Default = new(SqliteTypeMappingSource.IntegerTypeName);
public static new SqliteULongTypeMapping Default { get; } = new(SqliteTypeMappingSource.IntegerTypeName);

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ public static void Create(
CreateJsonValueReaderWriter((JsonValueReaderWriter)jsonReaderWriterProperty.GetValue(converter)!, parameters, codeHelper);

mainBuilder
.Append(")")
.DecrementIndent();
.Append(")");
}
}

Expand Down Expand Up @@ -443,8 +442,7 @@ public static void Create(
Create((ValueComparer)elementComparerProperty.GetValue(comparer)!, parameters, codeHelper);

mainBuilder
.Append(")")
.DecrementIndent();
.Append(")");
}
}

Expand Down
Loading

0 comments on commit 21b6191

Please sign in to comment.