Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions entity-framework/core/modeling/generated-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can also specify a SQL fragment that is used to calculate the default value:

[!code-csharp[Main](../../../samples/core/Modeling/GeneratedProperties/FluentAPI/DefaultValueSql.cs?name=DefaultValueSql&highlight=3)]

Starting with EF 10, for SQL Server you can explicitly specify the name for default value constraints, giving you more control over your database schema.
Starting with EF 10, for SQL Server you can explicitly specify the name for default value constraints, giving you more control over your database schema.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @AndriySvyryd there were some weird whitespace chars here which I converted to regular spaces

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I blame Copilot

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So convenient... ;)


[!code-csharp[Main](../../../samples/core/Modeling/GeneratedProperties/FluentAPI/DefaultValue.cs?name=DefaultValueNamed&highlight=3)]

Expand All @@ -33,8 +33,7 @@ You can also call `UseNamedDefaultConstraints` to enable automatic naming of all
```C#
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder
.UseNamedDefaultConstraints();
modelBuilder.UseNamedDefaultConstraints();
}

```
Expand Down
10 changes: 5 additions & 5 deletions entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ See [#12793](https://github.com/dotnet/efcore/issues/12793) and [#35367](https:/
- Translate `COALESCE` as `ISNULL` on SQL Server, for most cases ([#34171](https://github.com/dotnet/efcore/pull/34171), contributed by [@ranma42](https://github.com/ranma42)).
- Support some string functions taking `char` as arguments ([#34999](https://github.com/dotnet/efcore/pull/34999), contributed by [@ChrisJollyAU](https://github.com/ChrisJollyAU)).
- Support `MAX`/`MIN`/`ORDER BY` using `decimal` on SQLite ([#35606](https://github.com/dotnet/efcore/pull/35606), contributed by [@ranma42](https://github.com/ranma42)).
- Support projecting different navigations (but same type) via conditional operator ([#34589](https://github.com/dotnet/efcore/issues/34589), contributed by [@ranma42](https://github.com/ranma42)).

## ExecuteUpdateAsync now accepts a regular, non-expression lambda

Expand Down Expand Up @@ -187,11 +188,11 @@ Thanks to [@aradalvand](https://github.com/aradalvand) for proposing and pushing

<a name="default-constrain-names"></a>

## Custom Default Constraint Names
## Custom default constraint names

In previous versions of EF Core, when you specified a default value for a property, EF Core would always let the database automatically generate a constraint name. Now, you can explicitly specify the name for default value constraints for SQL Server, giving you more control over your database schema.
In previous versions of EF Core, when you specified a default value for a property, EF Core would always let the database automatically generate a constraint name. Now, you can explicitly specify the name for default value constraints for SQL Server, giving you more control over your database schema.

You can now specify a constraint name when defining default values in your model configuration:
You can now specify a constraint name when defining default values in your model configuration:

```C#
protected override void OnModelCreating(ModelBuilder modelBuilder)
Expand All @@ -212,8 +213,7 @@ You can also call `UseNamedDefaultConstraints` to enable automatic naming of all
```C#
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder
.UseNamedDefaultConstraints();
modelBuilder.UseNamedDefaultConstraints();
}

```
Expand Down