Skip to content

Commit 74675f3

Browse files
added fixes
1 parent 255241c commit 74675f3

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

examples/EntityFrameworkCore.Ydb.Samples/Database.Operations.Tutorial/HRContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.EntityFrameworkCore;
33
using Microsoft.EntityFrameworkCore.Diagnostics;
44
using Microsoft.Extensions.Configuration;
5-
using Microsoft.Extensions.Logging;
65

76
namespace Section_3.ProjectEF;
87

@@ -31,7 +30,6 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
3130
var connectionString = configuration.GetConnectionString("Local");
3231

3332
optionsBuilder.UseYdb(connectionString)
34-
.LogTo(Console.WriteLine, new[] { DbLoggerCategory.Database.Command.Name }, LogLevel.Information)
3533
.ConfigureWarnings(warnings => warnings.Ignore(RelationalEventId.PendingModelChangesWarning))
3634
.EnableSensitiveDataLogging();
3735
}

examples/EntityFrameworkCore.Ydb.Samples/Database.Operations.Tutorial/README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@ Based on the [tutorial](https://www.csharptutorial.net/entity-framework-core-tut
66

77
## Running
88

9-
Run all operations sequentially with:
10-
11-
```bash
12-
dotnet run
13-
```
9+
1. Set up [YDB local](https://ydb.tech/docs/en/reference/docker/start).
10+
11+
2. Install the EF Core CLI tool and dependencies (if needed):
12+
```bash
13+
dotnet tool install --global dotnet-ef
14+
dotnet add package Microsoft.EntityFrameworkCore.Design
15+
```
16+
17+
3. Create the database and apply migrations:
18+
```bash
19+
dotnet ef migrations add InitialCreate
20+
dotnet ef database update
21+
```
22+
23+
4. Run all operations sequentially with:
24+
```bash
25+
dotnet run
26+
```
1427

1528
## Available Operations
1629

0 commit comments

Comments
 (0)