Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a8567ad
[release/10.0] Source code updates from dotnet/dotnet (#37548)
dotnet-maestro[bot] Jan 22, 2026
c1d5057
Update dependencies (#37550)
dotnet-maestro[bot] Jan 22, 2026
10ac4da
Update dependencies (#37558)
dotnet-maestro[bot] Jan 24, 2026
febee78
[release/10.0] Source code updates from dotnet/dotnet (#37567)
dotnet-maestro[bot] Jan 28, 2026
9b47be7
Update dependencies (#37580)
dotnet-maestro[bot] Jan 29, 2026
45e3af0
Update dependencies (#37582)
dotnet-maestro[bot] Jan 29, 2026
5433114
Update dependencies (#37584)
dotnet-maestro[bot] Jan 30, 2026
02373a8
[release/10.0] Source code updates from dotnet/dotnet (#37586)
dotnet-maestro[bot] Jan 30, 2026
0a364d3
Update dependencies (#37589)
dotnet-maestro[bot] Jan 30, 2026
d2a06fd
Update dependencies (#37596)
dotnet-maestro[bot] Jan 31, 2026
545fca5
Update dependencies (#37597)
dotnet-maestro[bot] Jan 31, 2026
3c3d110
Update dependencies (#37599)
dotnet-maestro[bot] Jan 31, 2026
ef80246
Update dependencies (#37602)
dotnet-maestro[bot] Feb 1, 2026
52a750f
Update dependencies (#37604)
dotnet-maestro[bot] Feb 1, 2026
cb57166
Update dependencies (#37608)
dotnet-maestro[bot] Feb 1, 2026
f8ab309
Update dependencies (#37612)
dotnet-maestro[bot] Feb 2, 2026
7b2471b
[release/10.0] Fix duplicate DbParameter naming uniquification (#37541)
roji Feb 2, 2026
2bea786
[release/10.0] Fix GO batch separator not recognized in comments and …
Copilot Feb 2, 2026
2ee4051
[release/10.0] Fix path separator issue on Linux/macOS in dotnet-ef t…
Copilot Feb 2, 2026
6cb0f35
Update dependencies (#37620)
dotnet-maestro[bot] Feb 3, 2026
01c196f
Merge branch 'main' into merge/release/10.0-to-main
AndriySvyryd Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ private readonly IDictionary<FromSqlExpression, Expression> _visitedFromSqlExpre
private ParametersCacheDecorator _parametersDecorator;
private ParameterNameGenerator _parameterNameGenerator;

private static readonly bool UseOldBehavior37189 =
AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue37189", out var enabled37189) && enabled37189;

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
Expand Down Expand Up @@ -123,7 +120,7 @@ private SqlParameterExpression VisitSqlParameter(SqlParameterExpression paramete
&& (existingTypeMapping.Converter is null && typeMapping.Converter is null
|| existingTypeMapping.Converter is not null && existingTypeMapping.Converter.Equals(typeMapping.Converter)))
{
return UseOldBehavior37189 ? parameter : existingParameter;
return existingParameter;
}

var uniquifiedName = UniquifyParameterName(parameter.Name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,15 @@ protected override void Generate(
builder.EndCommand();
}

private enum ParsingState
{
Normal,
InBlockComment,
InSquareBrackets,
InDoubleQuotes,
InQuotes
}

/// <summary>
/// Builds commands for the given <see cref="SqlOperation" /> by making calls on the given
/// <see cref="MigrationCommandListBuilder" />, and then terminates the final command.
Expand All @@ -1402,12 +1411,13 @@ protected override void Generate(SqlOperation operation, IModel? model, Migratio
.Replace("\\\r\n", "")
.Split(["\r\n", "\n"], StringSplitOptions.None);

var quoted = false;
var state = ParsingState.Normal;
var batchBuilder = new StringBuilder();
foreach (var line in preBatched)
{
var trimmed = line.TrimStart();
if (!quoted

if (state == ParsingState.Normal
&& trimmed.StartsWith("GO", StringComparison.OrdinalIgnoreCase)
&& (trimmed.Length == 2
|| char.IsWhiteSpace(trimmed[2])))
Expand All @@ -1427,31 +1437,34 @@ protected override void Generate(SqlOperation operation, IModel? model, Migratio
}
else
{
var commentStart = false;
foreach (var c in trimmed)
for (var i = 0; i < trimmed.Length; i++)
{
switch (c)
var c = trimmed[i];
var next = i + 1 < trimmed.Length ? trimmed[i + 1] : '\0';

if (state == ParsingState.Normal && c == '-' && next == '-')
{
case '\'':
quoted = !quoted;
commentStart = false;
break;
case '-':
if (!quoted)
{
if (commentStart)
{
goto LineEnd;
}
goto LineEnd;
}

commentStart = true;
}
state = state switch
{
ParsingState.Normal when c == '\'' => ParsingState.InQuotes,
ParsingState.Normal when c == '[' => ParsingState.InSquareBrackets,
ParsingState.Normal when c == '"' => ParsingState.InDoubleQuotes,
ParsingState.Normal when c == '/' && next == '*' => ConsumeAndReturn(ref i, ParsingState.InBlockComment),

break;
default:
commentStart = false;
break;
}
ParsingState.InQuotes when c == '\'' => ParsingState.Normal,

ParsingState.InSquareBrackets when c == ']' && next == ']' => ConsumeAndReturn(ref i, ParsingState.InSquareBrackets),
ParsingState.InSquareBrackets when c == ']' => ParsingState.Normal,

ParsingState.InDoubleQuotes when c == '"' => ParsingState.Normal,

ParsingState.InBlockComment when c == '*' && next == '/' => ConsumeAndReturn(ref i, ParsingState.Normal),

_ => state
};
}

LineEnd:
Expand All @@ -1461,6 +1474,12 @@ protected override void Generate(SqlOperation operation, IModel? model, Migratio

AppendBatch(batchBuilder.ToString());

ParsingState ConsumeAndReturn(ref int index, ParsingState newState)
{
index++;
return newState;
}

void AppendBatch(string batch)
{
if (!string.IsNullOrWhiteSpace(batch))
Expand Down
14 changes: 9 additions & 5 deletions src/dotnet-ef/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ public static Project FromFile(

var designAssembly = runtimeCopyLocalItems
.Select(i => i["FullPath"])
.FirstOrDefault(i => i.Contains("Microsoft.EntityFrameworkCore.Design", StringComparison.InvariantCulture));
.FirstOrDefault(i => i.Contains("Microsoft.EntityFrameworkCore.Design", StringComparison.InvariantCulture))
?.Replace('\\', Path.DirectorySeparatorChar);
var properties = metadata.Properties;

var outputPath = Path.GetFullPath(Path.Combine(properties[nameof(ProjectDir)]!, properties[nameof(OutputPath)]!));
var normalizedOutputPath = properties[nameof(OutputPath)]!.Replace('\\', Path.DirectorySeparatorChar);
var normalizedProjectDir = properties[nameof(ProjectDir)]!.Replace('\\', Path.DirectorySeparatorChar);
var normalizedProjectAssetsFile = properties[nameof(ProjectAssetsFile)]?.Replace('\\', Path.DirectorySeparatorChar);
var outputPath = Path.GetFullPath(Path.Combine(normalizedProjectDir, normalizedOutputPath));
CopyBuildHost(runtimeCopyLocalItems, outputPath);

var platformTarget = properties[nameof(PlatformTarget)];
Expand All @@ -116,10 +120,10 @@ public static Project FromFile(
AssemblyName = properties[nameof(AssemblyName)],
DesignAssembly = designAssembly,
Language = properties[nameof(Language)],
OutputPath = properties[nameof(OutputPath)],
OutputPath = normalizedOutputPath,
PlatformTarget = platformTarget,
ProjectAssetsFile = properties[nameof(ProjectAssetsFile)],
ProjectDir = properties[nameof(ProjectDir)],
ProjectAssetsFile = normalizedProjectAssetsFile,
ProjectDir = normalizedProjectDir,
RootNamespace = properties[nameof(RootNamespace)],
RuntimeFrameworkVersion = properties[nameof(RuntimeFrameworkVersion)],
TargetFileName = properties[nameof(TargetFileName)],
Expand Down
3 changes: 1 addition & 2 deletions src/dotnet-ef/RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ protected override int Execute(string[] _)
Path.GetDirectoryName(typeof(Program).Assembly.Location)!,
"tools");

var targetDir = Path.GetFullPath(Path.Combine(startupProject.ProjectDir!, startupProject.OutputPath!))
.Replace('\\', Path.DirectorySeparatorChar);
var targetDir = Path.GetFullPath(Path.Combine(startupProject.ProjectDir!, startupProject.OutputPath!));
var targetPath = Path.Combine(targetDir, project.TargetFileName!);
var startupTargetPath = Path.Combine(targetDir, startupProject.TargetFileName!);
var depsFile = Path.Combine(
Expand Down
Loading
Loading