

However, migrations can only do the kinds of changes that the EF Core provider supports, and the SQLite provider's capabilities are limited. Migrations updates the database schema to match changes in the data model. If you have a favorite SQLite tool, leave a comment on what you like about it.įor this tutorial, the Entity Framework Core migrations feature is used where possible. The image below is from DB Browser for SQLite. There are many third-party tools you can download to manage and view a SQLite database. SQLite is the most used database engine in the world. SQLite is a self-contained, high-reliability, embedded, full-featured, public-domain, SQL database engine. Right-click on the Movie table and select View Data:

By default, EF creates a property named ID for the primary key. Right-click on the Movie table and select View Designer: By default, LocalDB database creates *.mdf files in the C:\Users\\ directory.įrom the View menu, open SQL Server Object Explorer (SSOX). LocalDB starts on demand and runs in user mode, so there's no complex configuration. LocalDB is a lightweight version of the SQL Server Express database engine that's targeted for program development.

For local development, configuration gets the connection string from the appsettings.json file. The ASP.NET Core Configuration system reads the ConnectionString key. Options.UseSqlite(("RazorPagesMovieContext") ? throw new InvalidOperationException("Connection string 'RazorPagesMovieContext' not found."))) Options.UseSqlServer(("RazorPagesMovieContext") ? throw new InvalidOperationException("Connection string 'RazorPagesMovieContext' not found."))) Var builder = WebApplication.CreateBuilder(args)
