Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kimtth/csharp-blazor-net-freecodecamp
👨💻 💜 csharp webassembly blazor - C# backend with Interactive UIs using C# instead of JavaScript.
https://github.com/kimtth/csharp-blazor-net-freecodecamp
Last synced: 1 day ago
JSON representation
👨💻 💜 csharp webassembly blazor - C# backend with Interactive UIs using C# instead of JavaScript.
- Host: GitHub
- URL: https://github.com/kimtth/csharp-blazor-net-freecodecamp
- Owner: kimtth
- Created: 2022-07-16T15:52:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-16T15:57:13.000Z (over 2 years ago)
- Last Synced: 2024-04-16T14:10:21.227Z (8 months ago)
- Language: C#
- Size: 18.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blazor WebAssembly and Web API on .NET 6
The source files refer to `freecodecamp.com` Blazor WebAssembly course mentioned below.
Base on that, I just attached Migration code files that have not been included on original source code. You can find those in `ShopOnline.API > Migrations` directory.- Screen
![screen](screen-shot.PNG "screenshot")
- Course Video
https://youtu.be/sHuuo9L3e5c
- Course Source code
https://github.com/GavinLonDigital/ShopOnlineSolution
- Course overview
https://www.freecodecamp.org/news/learn-blazor-webassembly-and-web-api-on-net-6-by-building-a-shopping-cart-app/
# ShopOnlineSolution
ShopOnlineSolution is part of a Blazor Shopping Cart Application video tutorial demonstrated on YouTube at this location,
https://youtu.be/3_AsedRrqww?list=PL4LFuHwItvKbdK-ogNsOx2X58hHGeQm8c# ShopOnline.API > appsetting.json - Database ConnectionString
You need to change the SQL server connection string as following your case.
In case of Azure SQL database, that is going to come from ADO.Net connection string.
```
Server=tcp:{your_azure_db}.database.windows.net,1433;Initial Catalog={db_name}};Persist Security Info=False;User ID={your_id};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
```# Migration command - C# Entity Framework
- For creating a migration code
```powershell
Add-Migration InitialCreate
```This command will create a file name such as "20220702030443_InitialCreate.cs". But this will make duplicated Up and Down functions, it will make a collision between "20220702030443_InitialCreate.cs" and "InitialCreate.cs". so that, Before executing "Update-database" you should rename InitialCreate in "InitialCreate.cs" as to "InitialCreate2" or whatever.
- Actual database creation and data are going to be triggered by this command.
```powershell
Update-database
```# Razor syntax
https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-6.0