.NET Backend kursi

C# tilida ASP.NET Core bilan zamonaviy backend dasturlash. Tildan boshlab Entity Framework Core, JWT autentifikatsiya, RESTful API va Docker gacha.

Boshlang'ich → O'rta · 83 ta dars · ~3 oy

Mavzular: C# tili, OOP, LINQ, Async/Await, ASP.NET Core, Entity Framework Core, JWT Auth, REST API, Test, Docker

Kirish — .NET Ekosistemi

  1. .NET nima? — tarix, ekosistem, C# bilan munosabati
  2. O'rnatish — .NET SDK, VS Code, birinchi dastur
  3. Loyiha tuzilmasi — .csproj, namespace, using, Program.cs
  4. dotnet CLI — new, build, run, add, restore

C# Asoslari

  1. O'zgaruvchilar va ma'lumot turlari — int, string, bool, double, var (tez kunda)
  2. Operatorlar — arifmetik, taqqoslash, mantiqiy, bitwise (tez kunda)
  3. Console I/O — WriteLine, ReadLine, Format, Interpolation (tez kunda)
  4. String — metodlar, interpolation, verbatim, StringBuilder (tez kunda)
  5. Shartli operatorlar — if/else, switch, ternary (?:) (tez kunda)
  6. Sikllar — for, while, do-while, foreach, break, continue (tez kunda)
  7. Massivlar — bir o'lchamli, ko'p o'lchamli, params (tez kunda)
  8. Kolleksiyalar — List<T>, Dictionary<K,V>, HashSet<T>, Queue, Stack (tez kunda)
  9. Metodlar — parametr, qaytish turi, overloading, optional parametrlar (tez kunda)
  10. Null va Nullable — ?, ??, ?. operatorlari, null-safety (tez kunda)
  11. Exception — try/catch/finally, throw, custom exception (tez kunda)

OOP — Obyektga Yo'naltirilgan Dasturlash

  1. Class va Object — yaratish, new, this kalit so'zi (tez kunda)
  2. Constructor — parametrli, default, this(), chaining (tez kunda)
  3. Properties — get/set, auto-property, computed, init (tez kunda)
  4. Encapsulation — public, private, protected, internal (tez kunda)
  5. Inheritance — : operatori, base, virtual/override, sealed (tez kunda)
  6. Polymorphism — method overriding, method hiding (new) (tez kunda)
  7. Abstract class — abstract metodlar, yaratib bo'lmaydi (tez kunda)
  8. Interface — I prefix, implement, bir nechta interface (tez kunda)
  9. Static — static class, static metod va xususiyat, singleton (tez kunda)
  10. Record — immutable data, with expression, record struct (tez kunda)

C# Ilg'or Tushunchalar

  1. Generics — <T>, constraint (where), generic metod va class (tez kunda)
  2. Delegates va Events — Func, Action, EventHandler, multicast (tez kunda)
  3. Lambda — => sintaksis, closure, qisqartirishlar (tez kunda)
  4. LINQ — Where, Select, OrderBy, GroupBy, Join, Aggregate (tez kunda)
  5. Async/Await — Task, async metod, ConfigureAwait, CancellationToken (tez kunda)
  6. Extension methods — this parametri, IEnumerable extension (tez kunda)
  7. Pattern matching — is, switch expression, when, deconstruction (tez kunda)
  8. Tuples — (int, string), naming, deconstruction, ValueTuple (tez kunda)
  9. Attributes — [Attribute], built-in, custom attribute yaratish (tez kunda)

ASP.NET Core — Kirish

  1. ASP.NET Core nima? — Web API, MVC, Minimal API, Kestrel (tez kunda)
  2. Birinchi Web API — dotnet new webapi, run, test (tez kunda)
  3. Program.cs — WebApplication.CreateBuilder, middleware pipeline (tez kunda)
  4. Dependency Injection — AddSingleton, AddScoped, AddTransient, nima farqi (tez kunda)
  5. Middleware — nima, pipeline, tartib, custom middleware yaratish (tez kunda)
  6. Configuration — appsettings.json, environment, User Secrets, IOptions (tez kunda)

Web API — Controller va Routing

  1. Controller — [ApiController], [Route], ControllerBase (tez kunda)
  2. HTTP GET va POST — [HttpGet], [HttpPost], IActionResult (tez kunda)
  3. HTTP PUT, PATCH, DELETE — update va o'chirish (tez kunda)
  4. Route parametrlari — {id}, [FromRoute], [FromQuery], [FromBody] (tez kunda)
  5. DTO — nima uchun, Entity dan ajratish, request/response DTO (tez kunda)
  6. Validation — Data Annotations, ModelState, [Required], [Range] (tez kunda)
  7. FluentValidation — AbstractValidator, kuchli validatsiya qoidalari (tez kunda)
  8. HTTP Status kodlar — 200, 201, 400, 401, 404, Ok(), BadRequest() (tez kunda)

Entity Framework Core — Ma'lumotlar Bazasi

  1. EF Core nima? — ORM, DbContext, DbSet, qanday ishlaydi (tez kunda)
  2. O'rnatish va sozlash — NuGet, DbContext, connection string, PostgreSQL (tez kunda)
  3. Model va Migration — Entity yaratish, Add-Migration, Update-Database (tez kunda)
  4. CRUD — Add, Find, Update, Remove, SaveChangesAsync (tez kunda)
  5. LINQ bilan so'rov — Where, FirstOrDefault, Include, AsNoTracking (tez kunda)
  6. One-to-Many munosabat — navigation property, foreign key, Include (tez kunda)
  7. Many-to-Many munosabat — join table, pivot, EF Core 5+ (tez kunda)
  8. One-to-One munosabat — HasOne, WithOne, FK joylashuvi (tez kunda)
  9. Repository Pattern — IRepository<T>, GenericRepository, abstraktsiya (tez kunda)

Autentifikatsiya va Avtorizatsiya

  1. Password Hashing — BCrypt.Net, hash va verify, SALT_ROUNDS (tez kunda)
  2. JWT nima? — Header, Payload, Signature, qanday ishlaydi (tez kunda)
  3. JWT o'rnatish — JwtBearer, token yaratish, sozlash (tez kunda)
  4. [Authorize] va [AllowAnonymous] — route himoya qilish (tez kunda)
  5. Refresh Token — access + refresh juftligi, rotation strategy (tez kunda)
  6. Role-based Authorization — [Authorize(Roles)], Claims, Policy (tez kunda)

Ilg'or ASP.NET Core

  1. AutoMapper — DTO ↔ Entity mapping, Profile, ProjectTo (tez kunda)
  2. Global Exception Handling — middleware, ProblemDetails, RFC 7807 (tez kunda)
  3. Logging — ILogger, Serilog, sink, structured logging (tez kunda)
  4. In-memory Cache — IMemoryCache, sliding/absolute expiration (tez kunda)
  5. Redis Cache — StackExchange.Redis, IDistributedCache (tez kunda)
  6. CORS — policy, AllowAnyOrigin, specific origins, credentials (tez kunda)
  7. Rate Limiting — .NET 7+ built-in, Fixed/Sliding window, per user (tez kunda)

API Sifati va Dizayn

  1. RESTful best practices — naming, status codes, idempotency (tez kunda)
  2. Swagger/OpenAPI — Swashbuckle, XML comments, authentication UI (tez kunda)
  3. API Versioning — URL, header, query string versioning (tez kunda)
  4. Health Checks — /health endpoint, DbContext, Redis check (tez kunda)
  5. Minimal API — MapGet/Post, endpoint filter, GroupRouteBuilder (tez kunda)

Test

  1. Unit Test — xUnit, [Fact], [Theory], Assert metodlar (tez kunda)
  2. Mocking — Moq, Mock<T>, Setup, Verify, In-memory DB (tez kunda)
  3. Integration Test — WebApplicationFactory, HttpClient, test DB (tez kunda)
  4. Test best practices — AAA pattern, naming, coverage, TDD kirish (tez kunda)

Deploy

  1. Docker — Dockerfile, .dockerignore, image yaratish, container (tez kunda)
  2. docker-compose — API + PostgreSQL + Redis bir yerda (tez kunda)
  3. Environment va Secrets — production sozlamalar, .env, secret management (tez kunda)
  4. Yakuniy loyiha — To-Do API: CRUD + JWT + EF Core + Docker (tez kunda)