-
- mkdir TodoApi
- cd TodoApi
- dotnet new webapi
-
Use SQLite instead of InMemory
- Startup.cs
public void ConfigureServices(IServiceCollection services) { services.AddDbContext<TodoContext>(options => options.UseSqlite("Data Source=TodoList.db")); services.AddMvc(); }
- Run
dotnet ef migrations add InitialCreate
to scaffold a migration and create the initial set of tables for the model. - Run
dotnet ef database update
to apply the new migration to the database. This command creates the database before applying migrations.- If you don't do this, you'll get errors like "SQLite Error 1: 'no such table"
-
Go back to tutorial in step 1
- The Postman demo is wrong. Need the plural noun in the url 'http://localhost:5000/api/todos' NOT 'http://localhost:5000/api/todo'
-
Notifications
You must be signed in to change notification settings - Fork 0
snarkitect/dotnetcore-todo-app
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published