Skip to content

Commit

Permalink
fixup! Scaffolding: Refactor some code
Browse files Browse the repository at this point in the history
Incorporate design meeting decisions
  • Loading branch information
bricelam committed Jul 8, 2022
1 parent e3305fe commit a586a41
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/EFCore.Design/Design/Internal/CSharpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,6 @@ private bool HandleList(IEnumerable<Expression> argumentExpressions, StringBuild
/// 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>
[Obsolete("Generate identifiers and type-qualified calls in the calling code instead.")]
public virtual string Fragment(MethodCallCodeFragment fragment, string? instanceIdentifier, bool typeQualified)
{
var builder = new StringBuilder();
Expand Down
24 changes: 3 additions & 21 deletions src/EFCore.Design/Migrations/Design/CSharpSnapshotGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ protected virtual void GenerateSequenceAnnotations(
var annotations = Dependencies.AnnotationCodeGenerator
.FilterIgnoredAnnotations(sequence.GetAnnotations())
.ToDictionary(a => a.Name, a => a);

GenerateAnnotations(sequenceBuilderName, sequence, stringBuilder, annotations, inChainedCall: true);
}

Expand Down Expand Up @@ -1818,26 +1818,8 @@ private void GenerateAnnotations(

foreach (var call in typeQualifiedCalls)
{
if (call.ChainedCall is not null)
{
throw new ArgumentException(DesignStrings.CannotGenerateTypeQualifiedMethodCall);
}

stringBuilder
.Append(call.DeclaringType!)
.Append('.')
.Append(call.Method)
.Append('(')
.Append(builderName);

for (var i = 0; i < call.Arguments.Count; i++)
{
stringBuilder
.Append(", ")
.Append(Code.UnknownLiteral(call.Arguments[i]));
}

stringBuilder.AppendLine(");");
stringBuilder.Append(Code.Fragment(call, builderName, typeQualified: true));
stringBuilder.AppendLine(";");
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/EFCore/Design/ICSharpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public interface ICSharpHelper
/// <see langword="true" /> if the method call should be type-qualified, <see langword="false" /> for instance/extension syntax.
/// </param>
/// <returns>The fragment.</returns>
[Obsolete("Generate identifiers and type-qualified calls in the calling code instead.")]
string Fragment(MethodCallCodeFragment fragment, string? instanceIdentifier, bool typeQualified);

/// <summary>
Expand Down

0 comments on commit a586a41

Please sign in to comment.