Sample app using AspNet Core MVC and Razor Pages
- Download Docker Desktop
- Execute:
docker run --name InventoryDb -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=Strong@Password" -p 11433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
- Download Sql Server Management Studio https://aka.ms/ssmsfullsetup
and connect to
localhost,11433
dotnet ef dbcontext scaffold "Data Source=localhost,11433; Initial Catalog=InventoryDb;user Id=sa; password=Strong@Password;Trust Server Certificate=true" Microsoft.EntityFrameworkCore.SqlServer --output-dir Models
Creamos el modelo
dotnet ef migrations add initialCreate --verbose --project Infrastructure -s .\InventoryAspCore\
dotnet ef database update --verbose --project Infrastructure -s .\InventoryAspCore\
migrationBuilder.UpdateData( table: "RequestValidationErrors", keyColumn: "WordCode", keyValue: "RequestValidationError.MoreThanOneItemFound", column: "IsBreaking", value: false);
public override void Up() { AddColumn("dbo.RequestValidationErrors", "IsBreaking", c => c.Boolean(nullable: false, default: true)); Sql("UPDATE dbo.RequestValidationErrors SET IsBreaking = 0 WHERE WordCode = "RequestValidationError.MoreThanOneItemFound""); }