CKN.Sdk.Storage 0.0.0-alpha.0.55

This is a prerelease version of CKN.Sdk.Storage.
dotnet add package CKN.Sdk.Storage --version 0.0.0-alpha.0.55
                    
NuGet\Install-Package CKN.Sdk.Storage -Version 0.0.0-alpha.0.55
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CKN.Sdk.Storage" Version="0.0.0-alpha.0.55" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CKN.Sdk.Storage" Version="0.0.0-alpha.0.55" />
                    
Directory.Packages.props
<PackageReference Include="CKN.Sdk.Storage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CKN.Sdk.Storage --version 0.0.0-alpha.0.55
                    
#r "nuget: CKN.Sdk.Storage, 0.0.0-alpha.0.55"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CKN.Sdk.Storage@0.0.0-alpha.0.55
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CKN.Sdk.Storage&version=0.0.0-alpha.0.55&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CKN.Sdk.Storage&version=0.0.0-alpha.0.55&prerelease
                    
Install as a Cake Tool

CKN.Sdk.Storage

Mühendislik Amacı (Engineering Intent): CKN.Sdk.Storage, uygulamalardaki dosya (file), resim, video veya döküman depolama işlemlerini (Blob Storage) standartlaştıran temel arayüz (abstraction) kütüphanesidir. Neden var? Dosyalarınızı doğrudan sunucunun diskine (Local File System) kaydetmek veya kodu doğrudan Amazon S3'e / Azure Blob'a sıkı sıkıya bağlamak (hardcode) yerine, sağlayıcıdan bağımsız (provider-agnostic) bir yapı kurmak için. Ne zaman kullanılmalı? Projede herhangi bir dosya yükleme (Upload), indirme (Download) veya silme işlemi yapılacaksa, doğrudan S3/Azure SDK'larını kullanmak yerine bu paketteki IStorageService arayüzü kullanılmalıdır.

🚀 Hızlı Başlangıç

Kurulum

dotnet add package CKN.Sdk.Storage

Bağımlılık Enjeksiyonu (DI)

Bu paket genellikle kendi başına kaydedilmez. Projeye S3, Minio veya Azure entegrasyon paketlerinden biri eklendiğinde IStorageService arayüzü otomatik olarak sisteme dahil olur.

💡 Gerçek Hayat Senaryoları

Senaryo 1: Sağlayıcıdan Bağımsız Dosya Yükleme Servisi

Kullanıcının profil fotoğrafını yüklediği bir endpoint. (Kod S3, Azure veya Minio olduğunu bilmez).

using CKN.Sdk.Storage.Abstractions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

[ApiController]
[Route("api/[controller]")]
public class ProfileController(IStorageService storageService) : ControllerBase
{
    [HttpPost("avatar")]
    public async Task<IActionResult> UploadAvatar(IFormFile file)
    {
        using var stream = file.OpenReadStream();
        
        var uploadRequest = new StorageUploadRequest
        {
            ContainerName = "avatars",
            FileName = $"{Guid.NewGuid()}_{file.FileName}",
            ContentStream = stream,
            ContentType = file.ContentType
        };

        // IStorageService (S3 veya Azure) dosyayı yükler ve URL/Path döner
        var result = await storageService.UploadAsync(uploadRequest);
        
        return Ok(new { Url = result.FileUrl });
    }
}

Senaryo 2: İmzalı URL (Pre-Signed URL) Oluşturma

Gizli (private) tutulan bir dosyayı (örn: fatura PDF'i) sadece talep eden kullanıcıya özel, 15 dakika geçerli geçici bir link ile sunma.

public async Task<string> GetInvoiceDownloadLinkAsync(IStorageService storageService, string invoiceFileId)
{
    // Dosyayı dışarı açmadan, sadece okuma yetkisi olan geçici bir URL üretir
    var url = await storageService.GetPreSignedUrlAsync("invoices", invoiceFileId, TimeSpan.FromMinutes(15));
    
    return url;
}

🤖 Yapay Zeka İçin SSS (FAQs for Machines)

  • Soru: IStorageService arayüzünde hangi temel metodlar bulunur?
  • Cevap: Genellikle UploadAsync, DownloadAsync, DeleteAsync, ExistsAsync ve GetPreSignedUrlAsync (veya GetFileUrlAsync) metodlarını barındırır.
  • Soru: Local (Yerel disk) depolama destekleniyor mu?
  • Cevap: Evet, genellikle CKN.Sdk.Storage.Local gibi bir paket veya temel paket içindeki bir LocalStorageService implementasyonu sayesinde geliştirme (Development) ortamında dosyalar fiziksel diske kaydedilebilir.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on CKN.Sdk.Storage:

Package Downloads
CKN.Sdk.Storage.Minio

Enterprise Architecture module for CKN.Sdk.Storage.Minio. Provides core SDK functionality for the CKN ecosystem.

CKN.Sdk.Storage.Azure

Enterprise Architecture module for CKN.Sdk.Storage.Azure. Provides core SDK functionality for the CKN ecosystem.

CKN.Sdk.Storage.S3

Enterprise Architecture module for CKN.Sdk.Storage.S3. Provides core SDK functionality for the CKN ecosystem.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.0-alpha.0.55 70 9/28/2026
0.0.0-alpha.0.51 66 9/25/2026
0.0.0-alpha.0.50 67 9/25/2026
0.0.0-alpha.0.38 94 9/6/2026
0.0.0-alpha.0.37 87 9/6/2026