Cohorts
  • Discover
  • About Us
  • Blog
  • Patika.dev
  • Web3

.Net Core

Tarihçe, .Net Framework vs .Net Core vs .Net5

.NET 5 Kurulumu
Visual Studio Code kurulumu

Http Protokolü
Restful Servisler
Restful vs Soap
JSON (JavaScript Object Notation)

Örnek Web Api Yaratmak

Startup ve Program Sınıfları
Ortam dosyaları

Controller Sınıfı
Route Kavramı
Action Methodlar
Okunabilir API tasarımı

Swagger Nedir? Nasıl Kullanılır?
Postman Nedir? Nasıl Kullanılır?
Api Debug Nasıl Yapılır?

Get ve GetById endpoint'lerinin yazılması
Put ve Post endpoint'lerinin yazılması
Delete endpoint'inin yazılması

İlişkisel ve NoSql Veritabanları
Table,Primary Key, Foreign Key Kavramları
Tablo İlişkileri

Temel SQL
ORM Nedir? ORM Araçları Nelerdir? Entity Framework Core'a Giriş
Örnek Projeye EF Core Dahil Etmek
DB Context kullanarak CRUD işlemler
Auto Increment ID kolonunun eklenmesi
Linq ile Crud İşlemler

Entity Kavramı
ViewModel ve Dto Kavramı
Ödev - Model Kullanımı
Ödev Çözümü - Model Kullanımı
AutoMapper

Modellerin Doğrulanması ve FluentValidation Kütüphanesi
Model Validasyonu - Ödev
Model Validasyonu - Ödev Çözümü

Middleware Kavramı
Custom Exception Middleware Yaratılmak

Dependency Nedir ?
Dependency Injection (DI) Kavramı
DI Container Kavramı
.NET Core DI Container (Services)
Projeye DI Container Kullanarak Logger Servis Eklemek

Pratik - Projeye Genre Controller ve Servislerin Eklenmesi

Ödev - Projeye Author Controller ve Servislerin Eklenmesi

Test Kavramı ve Çeşitleri
TDD (Test Driven Development) Nedir ?
Örnek Test Yazımı
Pratik - Command ve Validator Sınıflarının Testlerinin Yazılması

Ödev - Projenin eksik testlerinin tamamlanması

Token Bazlı Kimlik Doğrulama ve Access Token Kullanımı
Refresh Token Kullanımı

Proje Ödevi - Movie Store Uygulaması

Proje Ödevi 2 - Serbest Proje Seçimi

Bir Projeye Entity Framework Core Nasıl Eklenir?


Bir .Net Core WebApi projesinde Ef Core kullanabilmek için öncelikler gerekli paketleri projeye dahil etmeliyiz. Dotnet'in paket yöneticisi Nuget Package Manager'dır.Localde çalışma yaparken gerçek bir veri tabanı ile çalışmak maliyetli olabilir. Bunun yerine hem implementasyonu kolay olan hem de hızlı çalışan InMemory database kullanılması önerilir. Ef Core'un tüm özelliklerini in memory database implemente ederek kullanabiliriz. BookStore uygulamamıza da In Memory database implemente ederek EF Core u kullanıcaz.


Projeyi In Memoery EF Core ile çalışır hale getirmek için izlememiz gereken adımlar şu şekildedir arkadaşlar.

1.Projeye Microsoft.EntityFrameworkCore'nin eklenmesi

  • WebApi proje dizininde aşağıdaki komutu çalıştırınız.
  • dotnet add package Microsoft.EntityFrameworkCore --version 5.0.6

2.Projeye Microsoft.EntityFrameworkCore.InMemory'nin eklenmesi.

  • WebApi proje dizininde aşağıdaki komutu çalıştırınız.


 `dotnet add package Microsoft.EntityFrameworkCore.InMemory --version 5.0.6  

3.Db operasyonları için kullanılacak olan DB Context'i yaratılması


public class BookStoreDbContext : DbContext
{
    public BookStoreDbContext(DbContextOptions<BookStoreDbContext> options) : base(options)
    {}
    public DbSet<Book> Books { get; set; }
  
}

4.Initial Data için bir Data Generator'ın yazılması


public class DataGenerator
{
    public static void Initialize(IServiceProvider serviceProvider)
    {
        using (var context = new BookStoreDbContext(
        serviceProvider.GetRequiredService<DbContextOptions<BookStoreDbContext>>()))
        {
            // Look for any book.
            if (context.Books.Any())
            {
                return;   // Data was already seeded
            }

            context.Books.AddRange(
               new Book()
               {
                   Title = "Lean Startup",
                   GenreId = (int)GenreEnum.PersonalGrowth, // Personal Growth
                   PageCount = 200,
                   PublishDate = new DateTime(2001, 06, 12)
               });

            context.SaveChanges();
        }
    }
}

5.Uygulama ayağa kalktığından initial datanın in memory DB'ye yazılması için Program.cs içerisinde configurasyon yapılması

public static void Main(string[] args)
        {
            //1. Get the IWebHost which will host this application.
            var host = CreateHostBuilder(args).Build();

            //2. Find the service layer within our scope.
            using (var scope = host.Services.CreateScope())
            {
                //3. Get the instance of BoardGamesDBContext in our services layer
                var services = scope.ServiceProvider;
                //4. Call the DataGenerator to create sample data
                DataGenerator.Initialize(services);
            }

            //Continue to run the application
            host.Run();
        }


6.Startup.cs içerisinde ConfigureServices() içerisinde DbContext'in servis olarak eklenmesi


services.AddDbContext<BookStoreDbContext>(options => options.UseInMemoryDatabase(databaseName: "BookStoreDB"));


6.Kullanmak istediğiniz yerde _context'i kurucu metot aracılığıyla ekleyerek kullabilirsiniz :)


readonly BookStoreDbContext _context;
public BookController(BookStoreDbContext context)
{
    _context = context;
}




Previous
Next

Lesson discussion

Swap insights and ask questions about “.Net Core”.

Enroll to participate
Start the course to unlock the discussion. Enrolling helps us keep conversations relevant to learners.
Cohorts
WebsiteDiscoverBlogPatika.devRise In
CoursesCircleRustSoliditySolanaWeb3 FundamentalsBlockchain Basics
CompanyAbout UsTerms of UsePrivacy PolicyGDPR NoticeCookies
Don't miss any update!

Disclaimer: The information, programs, and events provided on https://cohorts.patika.dev is strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice, nor do we make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://cohorts.patika.dev disclaims any responsibility for financial decisions made by users based on the information provided here.

© 2026 Cohorts, All rights reserved