Skip to content

Commit d55bc66

Browse files
committed
Improve the --nativeaot description
1 parent 49d1065 commit d55bc66

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/dotnet-ef/Properties/Resources.resx

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
<value>The namespace to use. Matches the directory by default.</value>
269269
</data>
270270
<data name="NativeAotDescription" xml:space="preserve">
271-
<value>Additionally generate all the code required for NativeAOT compilation and precompiled queries (experimental).</value>
271+
<value>Generate additional code in the compiled model required for NativeAOT compilation and precompiled queries (experimental).</value>
272272
</data>
273273
<data name="NativeAotWarning" xml:space="preserve">
274274
<value>NativeAOT support is experimental and can change in the future.</value>

src/ef/Commands/DbContextOptimizeCommand.cs

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ protected override int Execute(string[] args)
3838
throw new CommandException(Resources.VersionRequired("6.0.0"));
3939
}
4040

41+
if ((_precompileQueries!.HasValue() || _nativeAot!.HasValue())
42+
&& new SemanticVersionComparer().Compare(EFCoreVersion, "9.0.0") < 0)
43+
{
44+
throw new CommandException(Resources.VersionRequired("9.0.0"));
45+
}
46+
4147
var result = executor.OptimizeContext(
4248
_outputDir!.Value(),
4349
_namespace!.Value(),

src/ef/Properties/Resources.resx

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
<value>The namespace to use. Matches the directory by default.</value>
302302
</data>
303303
<data name="NativeAotDescription" xml:space="preserve">
304-
<value>Additionally generate all the code required for NativeAOT compilation and precompiled queries (experimental).</value>
304+
<value>Generate additional code in the compiled model required for NativeAOT compilation and precompiled queries (experimental).</value>
305305
</data>
306306
<data name="NativeAotWarning" xml:space="preserve">
307307
<value>NativeAOT support is experimental and can change in the future.</value>

0 commit comments

Comments
 (0)