You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Study SQL and integrate new data from MS SQL server object explorer
Study dependency injection and what makes it work
Setup: Core ASP vs ASP.NET Framework and containers.
Ensure you're running a regular visual studio gitignore.
Here's what they don't tell you :)
Core ASP is compatible with .NET 6+ while ASP.NET Framework is only compatible with 4.7 versions which is quite old. I personally chose to do a ASP.Net core web app simply because of that issue.
Windows 11 users beware! For Razor pages, it MUST be ran using windows containers or else you will see issues within the page!!!
Why though? Because Docker linux is compatible with Windows 11 Enterprise.
Why do we care? If you're running a Docker Linux container, you cannot run the page with the data you've integrated via script, sql file, etc.
How do we fix this? Don't use docker and ensure it's unchecked when you create the project. Run the default windows container and test the site via ctrl+F5.
Documentation (NOTE, this is going to match the guide):
I created a Razor page named Movies via add new scaffold item and ensured that the Model class and the database provider was accurate.
Updated the database via PMC within the NuGet Package Manager NOTE: DO NOT SKIP THIS STEP!
Created the property for the entity set (the database table)
Now within the webbar, you have to type in the specific page name. Note: save yourself some trouble and use Edge or perhaps Chrome...Firefox cannot establish a connection...*
Feel free to create new pieces of data here. Additionally, you can edit the data via C# with the SeedData script mentioned within the MS tutorial.
Now here's where things got tricky. Issues mentioned here:
Working with a database.
When you open SQL Server Object Explorer, you can see a bunch of files and stuff. Ensure you're looking at the correct database.
How? Print it to the console via C# script.
I'm still confused as to what the name is. Where do I go to find it? You'll find it in the console.exe
Now you should be able to see your fields. Welcome to the beginning. What it opens by default is a T-SQL file based on your localdatabase. Lots more on this later.
Later has now arrived. Buckle your seatbelts because now it's time for the hard stuff.
Working with T-SQL
Here's how you can pull up the screen.
Go to View > SQL Server Object Explorer.
Then view The local DB MSSQL in the SQL server via the name MSSQLLocalDb within databases, go to the proper database using the drop down button.
Double click the table name with the icon and note the DB name (You'll need this later!!!)
Boom, the screen shows as expected.
Right click on the table name and select view data to see what's already in the Razor page.
Then from here you can select the script button towards the top.