EntegratorPro.Core 1.0.10

dotnet add package EntegratorPro.Core --version 1.0.10                
NuGet\Install-Package EntegratorPro.Core -Version 1.0.10                
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="EntegratorPro.Core" Version="1.0.10" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EntegratorPro.Core --version 1.0.10                
#r "nuget: EntegratorPro.Core, 1.0.10"                
#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.
// Install EntegratorPro.Core as a Cake Addin
#addin nuget:?package=EntegratorPro.Core&version=1.0.10

// Install EntegratorPro.Core as a Cake Tool
#tool nuget:?package=EntegratorPro.Core&version=1.0.10                

EntegratorPro.Core

EntegratorPro.Core, EntegratorPro platformunun temel işlevselliklerini sağlayan bir yardımcı kütüphane ve repository altyapısı sunar. Yaygın işlemlere yönelik yardımcı metotlar (Helpers) ve depolama işlemleri için bir repository yapısını içerir.


Özellikler

  • Helpers (Yardımcı Sınıflar):

    • Şifreleme (EncryptionHelper)
    • Hashing (HashingHelper)
    • Rastgele Değer Oluşturma (RandomHelper)
    • Enum İşlemleri (EnumHelper)
  • Repository (Depo) Altyapısı:

    • Genel CRUD işlemleri (IRepository)
    • Entity Framework desteği (IEfRepository)
    • DTO temelli servis işlemleri (IServiceRepository)

Kurulum

EntegratorPro.Core paketini NuGet aracılığıyla proje içine ekleyebilirsiniz.

.NET CLI:

dotnet add package EntegratorPro.Core

Package Manager Console:

Install-Package EntegratorPro.Core

Kullanım

Yardımcı Sınıflar

1. Şifreleme Yardımcısı (EncryptionHelper)
using EntegratorPro.Core.Helpers;

public class EncryptionExample
{
    public void Run()
    {
        string password = "secure-password";
        string plainText = "Hello, World!";

        string encryptedText = EncryptionHelper.Encrypt(plainText, password);
        string decryptedText = EncryptionHelper.Decrypt(encryptedText, password);

        Console.WriteLine($"Encrypted: {encryptedText}");
        Console.WriteLine($"Decrypted: {decryptedText}");
    }
}
2. Hashing Yardımcısı (HashingHelper)
using EntegratorPro.Core.Helpers;

public class HashingExample
{
    public void Run()
    {
        string password = "my-password";

        HashingHelper.CreatePasswordHash(password, out var hash, out var salt);
        bool isValid = HashingHelper.VerifyPasswordHash(password, hash, salt);

        Console.WriteLine($"Password is valid: {isValid}");
    }
}
3. Rastgele Değer Yardımcısı (RandomHelper)
using EntegratorPro.Core.Helpers;

public class RandomExample
{
    public void Run()
    {
        string numeric = RandomHelper.Numeric(8);
        string alpha = RandomHelper.Character(10);
        string alphanumeric = RandomHelper.Mixed(12);

        Console.WriteLine($"Numeric: {numeric}");
        Console.WriteLine($"Alphabetic: {alpha}");
        Console.WriteLine($"Alphanumeric: {alphanumeric}");
    }
}
4. Enum Yardımcısı (EnumHelper)
using EntegratorPro.Core.Helpers;
using System.ComponentModel.DataAnnotations;

public enum Status
{
    [Display(Name = "Active")]
    Active = 1,

    [Display(Name = "Inactive")]
    Inactive = 2
}

public class EnumExample
{
    public void Run()
    {
        var list = EnumHelper.List<Status>();
        string displayName = EnumHelper.GetDisplayValue(Status.Active);

        foreach (var item in list)
            Console.WriteLine($"ID: {item.Key}, Name: {item.Value}");

        Console.WriteLine($"Display Name: {displayName}");
    }
}

Repository Kullanımı

Repository'ler projelerde sık kullanılan CRUD işlemlerini etkili bir şekilde yönetmek için yapılandırılmıştır.

1. Genel Repository (IRepository)
using EntegratorPro.Core.Repositories;

public class GenericRepositoryExample<TEntity, TKey>
    where TEntity : class, IEntity<TKey>
    where TKey : notnull
{
    private readonly IRepository<TEntity, TKey> _repository;

    public GenericRepositoryExample(IRepository<TEntity, TKey> repository)
    {
        _repository = repository;
    }

    public async Task RunAsync()
    {
        TEntity entity = await _repository.GetAsync(default!);
        bool exists = await _repository.AnyAsync(default!);
        await _repository.InsertAsync(entity);
        await _repository.UpdateAsync(entity);
        await _repository.DeleteAsync(entity);

        Console.WriteLine($"Entity Exists: {exists}");
    }
}
2. Entity Framework Repository (IEfRepository)
using EntegratorPro.Core.Repositories;

public class EfRepositoryExample<TEntity, TKey>
    where TEntity : class, IEntity<TKey>, new()
    where TKey : IEquatable<TKey>
{
    private readonly IEfRepository<TEntity, TKey> _efRepository;

    public EfRepositoryExample(IEfRepository<TEntity, TKey> efRepository)
    {
        _efRepository = efRepository;
    }

    public async Task RunAsync()
    {
        var pagedData = await _efRepository.PagedAsync(1, 10);
        IQueryable<TEntity> queryable = _efRepository.AsNoTracking;

        Console.WriteLine($"Paged Data Count: {pagedData.Data.Count}, Total Count: {pagedData.TotalCount}");
    }
}
3. Servis Repository (IServiceRepository)
using EntegratorPro.Core.Repositories;
using EntegratorPro.Core.Signatures;

public class DtoExample : IDto { }

public class ServiceRepositoryExample
{
    private readonly IServiceRepository<DtoExample, int> _serviceRepository;

    public ServiceRepositoryExample(IServiceRepository<DtoExample, int> serviceRepository)
    {
        _serviceRepository = serviceRepository;
    }

    public async Task RunAsync()
    {
        var dto = new DtoExample();
        await _serviceRepository.InsertAsync(dto);
        DtoExample fetchedDto = await _serviceRepository.GetAsync(1);

        Console.WriteLine($"Fetched DTO: {fetchedDto}");
    }
}

Gereksinimler

  • .NET Sürümü: .NET 9.0
  • Dil: C# 12.0

Lisans

Bu proje MIT Lisansı ile lisanslanmıştır. Daha fazla bilgi için LICENSE dosyasını inceleyebilirsiniz.


Bu kütüphane, projelerinizde sık kullanılan operasyonları hızlı ve etkili bir şekilde gerçekleştirmenize olanak sağlar. Teşekkürler!

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on EntegratorPro.Core:

Package Downloads
EntegratorPro.EntityFrameworkCore

EntegratorPro.EntityFrameworkCore Library

EntegratorPro.Cache

EntegratorPro.Cache Library

EntegratorPro.Identity

EntegratorPro.Identity Library

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.10 236 3/8/2025
1.0.9 159 3/7/2025
1.0.8 158 3/7/2025
1.0.7 153 3/7/2025
1.0.6 224 2/23/2025
1.0.5 75 2/23/2025
1.0.4 77 2/23/2025
1.0.3 300 2/23/2025
1.0.2 88 2/23/2025
1.0.1 102 2/23/2025