.NET Training Batch 2 (Dec 4, 2023 - Mar 12, 2024)

Blazor Server (Server Side)

  • Db Blazor Web Assembly (Client Side) download files into browser
  • Frontend => API Call (HttpClient)
  • Offline

Blazor Server Blog Blazor Web Assembly Blog


Clear git local cache

git rm -r --cached .
git add .
git commit -am 'git cache cleared'
git push
create proc Sp_GetBlogs
@pageNo int,
@pageSize int
as
begin

select * from Tbl_Blog
order by Blog_Id
OFFSET ((@pageNo - 1) * @pageSize) ROWS
FETCH NEXT @pageSize ROWS ONLY

end

https://www.jqueryscript.net/popular/2023.html

Business1 => repo, data access 1 => data access 2 Business1 => repo, data access 2 => data access 2

Repo

  • CRUD

Data Access 1

  • CRUD

Data Access 2

  • CRUD

Business1 Transfer

  • Balance Check
  • From Account = - Amount
  • To Account = + Amount

Repo = Data Access 1

Data Access 1

  • Check
  • Debit
  • Credit

Data Access 2

  • Check
  • Debit
  • Credit

Dependency injection is a powerful technique that promotes loosely coupled, maintainable, and testable code. By applying dependency injection principles in your C# projects, you can achieve better modularity, reusability, and flexibility.

Refit RestSharp

XML JSON Javascript Object JSON Object Format / Compress

API HTTP Method

  • Get => Read
  • Post => Ceate
  • Put => Update
  • Patch => Update
  • Delete => Delete

HTTP Status Code

  • 200 - OK
  • 404 - Not Found
  • 500 - Internal Server Error
  • 402, 403, 409

  • 100 - 199
  • 200 - 299
  • 300 - 399

HTTP response status codes TrustServerCertificate EF Core Database First dotNet tool install --global dotnet-ef

Install DotNet EF

dotnet tool install --global dotnet-ef --version 7

Package Manager Console

Scaffold-DbContext "Server=.\SQLExpress;Database=SchoolDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

Terminal

dotnet ef dbcontext scaffold "Server=.;Database=TestDb;User ID=sa;Password=sa@123;Trusted_Connection=True;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -c AppDbContext -o EFDbContextModel

EFCore Code First (C# Class => Database Table) Database First (Database Table => C# Class)


  • GraphQL
  • gRPC

NuGet Package = npm