Entity Framework Core
Links
- Entity Framework Code First Migrations in Team Environments
- Entity Framework Core Tutorial
- ms docs ef core
- Using Azure database for PostgreSQL in ASP.NET Core (with EF Core) Jan18
- EF Core or micro-ORM?
- Entity Framework Core 2.1 Roadmap
- explicit loading
- implement infrastructure persistence layer with Entity Framework Core
recipes
-
use an in memory db for tests
public class MessagingDbContext : Microsoft.EntityFrameworkCore.DbContext { /* ... */ } return new MessagingDbContext(new DbContextOptionsBuilder<MessagingDbContext>().UseInMemoryDatabase(databaseName: DB_NAME).Options)
-
Fix
$ dotnet ef database update
returning No executable found matching command “dotnet-ef”. Modify csproj.<PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1"/> <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet"> <Version>1.0.0-*</Version> </DotNetCliToolReference>
-
Generate migration from Powershell / Git Bash
install-package entityframework.commands -pre dotnet ef migrations add "Initial" -o "Data\Migrations" dotnet ef database update