Skip to content

Commit c00dee1

Browse files
CopilotAndriySvyryd
andcommitted
Address feedback: remove additional resources section, update convention text, remove fluent API section, fix file ending
Co-authored-by: AndriySvyryd <[email protected]>
1 parent eba15dc commit c00dee1

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

entity-framework/core/providers/sqlite/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ Install-Package Microsoft.EntityFrameworkCore.Sqlite
3434
## Limitations
3535

3636
See [SQLite Limitations](xref:core/providers/sqlite/limitations) for some important limitations of the SQLite provider.
37-
38-
## Additional Resources
39-
40-
* [SQLite Value Generation](xref:core/providers/sqlite/value-generation) - Information about SQLite AUTOINCREMENT and value generation patterns.

entity-framework/core/providers/sqlite/value-generation.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,10 @@ By convention, numeric primary key columns that are configured to have their val
1515

1616
### Configuring AUTOINCREMENT
1717

18-
By convention, integer primary keys are automatically configured with AUTOINCREMENT when they don't have an explicitly assigned value. However, you may need to explicitly configure a property to use SQLite AUTOINCREMENT when the property has a value conversion from a non-integer type, or when overriding conventions:
18+
By convention, integer primary keys are automatically configured with AUTOINCREMENT when they are not composite and don't have a foreign key on them. However, you may need to explicitly configure a property to use SQLite AUTOINCREMENT when the property has a value conversion from a non-integer type, or when overriding conventions:
1919

2020
[!code-csharp[Main](../../../../samples/core/Sqlite/ValueGeneration/SqliteAutoincrementWithValueConverter.cs?name=SqliteAutoincrementWithValueConverter&highlight=6)]
2121

22-
Starting with EF Core 10, you can also use the new Fluent API:
23-
24-
```csharp
25-
protected override void OnModelCreating(ModelBuilder modelBuilder)
26-
{
27-
modelBuilder.Entity<BlogPost>()
28-
.Property(b => b.Id)
29-
.HasConversion<int>()
30-
.UseAutoincrement();
31-
}
32-
```
33-
34-
This is equivalent to using the more general value generation API:
35-
36-
```csharp
37-
protected override void OnModelCreating(ModelBuilder modelBuilder)
38-
{
39-
modelBuilder.Entity<Blog>()
40-
.Property(b => b.Id)
41-
.ValueGeneratedOnAdd();
42-
}
43-
```
44-
4522
## Disabling AUTOINCREMENT for default SQLite value generation
4623

4724
In some cases, you may want to disable AUTOINCREMENT and use SQLite's default value generation behavior instead. You can do this using the Metadata API:
@@ -91,4 +68,4 @@ migrationBuilder.CreateTable(
9168
});
9269
```
9370

94-
This ensures that the AUTOINCREMENT feature is properly applied when the migration is executed against the SQLite database.
71+
This ensures that the AUTOINCREMENT feature is properly applied when the migration is executed against the SQLite database.

0 commit comments

Comments
 (0)