This sample project contains features for Entity Framework Core Code First Migrations.
- Microsoft.EntityFrameWorkCore
- Microsoft.EntityFrameWorkCore.Tools
- Microsoft.EntityFrameWorkCore.SqlServer
- View > Sql Server Object Explorer
- (localdb)\MSSQLLocalDB
- No Database, Option 1: Tools > Get Tools and Features > Data Storage and Processing > Sql Server Data Tools
- No Database, Option 2: You can also use a tool like SQL Server Management Studio.
- Create New Database
- Right Click Database > Properties > Connection String
- Use template in AppSettings.json, Program.cs
- Tools > NuGet Package Manager > Package Manager Console
- update-database
- Enter records for products
- localhost:xx/swagger/index.html
- Try It Out on GET api/product
- Core Entity Framework
- Core API
- Core Services
- MVC & ViewModels
- Simple Authentication
- Image/File Upload
- Role Based Authorization
- Conditional Access
- Conditional Rendering
- Client Integration
- Workers and Server to Server Communication
- Modify Product.cs to include ProductPrice (decimal)
- Tools > NuGet Package Manager > Package Manager Console > add-migration productprice
- Update the database with the new product price migration, creating the price column on the product table
- Add a new entity /Models/Review.cs
- Register 'Reviews' in AppDbContext.cs
- Add a migration 'review'
- Update the database with the review migration, creating a reviews table
- Link Customers and Reviews (One customer may write many reviews, each review for one customer)
- Add-Migration 'customer-reviews'
- Update the database with the customer reviews migration, creating a customer ID FK on the review table
- Create a migration which links the review to the product as well (one product has many reviews, each review for one product)
- Modify Review.cs to have 'Stars' as an integer
- add-migration 'stars'
- update database customer reviews to go back to customer reviews migration
- remove-migration
- update database
- change Review.cs Stars to a float
- add-migration
- update-database