Azka 4.0.0-alpha.5

This is a prerelease version of Azka.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Azka --version 4.0.0-alpha.5                
NuGet\Install-Package Azka -Version 4.0.0-alpha.5                
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="Azka" Version="4.0.0-alpha.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Azka --version 4.0.0-alpha.5                
#r "nuget: Azka, 4.0.0-alpha.5"                
#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 Azka as a Cake Addin
#addin nuget:?package=Azka&version=4.0.0-alpha.5&prerelease

// Install Azka as a Cake Tool
#tool nuget:?package=Azka&version=4.0.0-alpha.5&prerelease                

Azka

This Package is base on Ardalis.Specification. On this version SaveChangesAsync already move from Repository to UnitOfWork

Entity

public class Item 
{
    // Property 
}

Repository

Interface Repository

public interface IItemRepository : Azka.Repository.IRepositoryBase<Item>
{
}

Implementation Repository

public class ItemRepository : Azka.Repository.RepositoryBase<Item>, IItemRepository
{
}

Unit Of Work

Interface Unit Of Work

public interface IUnitOfWork : Azka.UnitOfWork.IUnitOfWorkBase 
{
    IItemRepository Items { get; } 
}

Implementation Unit Of Work

public class UnitOfWork : Azka.UnitOfWork.UnitOfWorkBase, IUnitOfWork
{
    private readonly DbContext _dbContext;
    public UnitOfWork(SqlServerDbContext dbContext) 
    {
        _dbContext = dbContext
    }
    
    private IItemRepository _itemRepository;
    public IItemRepository Item => _itemRepository = _itemRepository??new ItemRepository(_dbContext);
}

Expression Composer

And

Example And

Expression<Func<Item, bool>> sample = f => f.Id == 1;
sample = sample.And(f => f.Name == "name");

result:

((f.Id == 1) AndAlso (f.Name == "name"))

Or

Expression<Func<Item, bool>> sample = f => f.Id == 1;
sample = sample.Or(f => f.Name == "name");

result:

((f.Id == 1) OrElse (f.Name == "name"))

Order By Expression By Property Name

using Ardalis.Specification;
using Azka.Extensions;

namespace AzkaUnitTest;

public sealed class ItemSpecification : Specification<Item>
{
    public ItemSpecification(string orderByProperty = nameof(Item.Id), OrderType orderType = OrderType.Ascending)
    {
        if (orderType == OrderType.Ascending)
        {
            Query.OrderBy(orderByProperty);
        }
        else
        {
            Query.OrderByDescending(orderByProperty);
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.0-alpha.34 51 12/7/2024
4.0.0-alpha.33 48 12/7/2024
4.0.0-alpha.32 45 12/7/2024
4.0.0-alpha.31 42 12/6/2024
4.0.0-alpha.30 41 12/6/2024
4.0.0-alpha.29 43 12/6/2024
4.0.0-alpha.28 43 12/2/2024
4.0.0-alpha.27 44 12/2/2024
4.0.0-alpha.26 48 12/2/2024
4.0.0-alpha.25 44 12/1/2024
4.0.0-alpha.24 43 12/1/2024
4.0.0-alpha.23 39 12/1/2024
4.0.0-alpha.22 44 12/1/2024
4.0.0-alpha.21 40 12/1/2024
4.0.0-alpha.20 39 12/1/2024
4.0.0-alpha.19 46 11/30/2024
4.0.0-alpha.18 50 11/24/2024
4.0.0-alpha.17 56 11/12/2024
4.0.0-alpha.16 77 5/6/2024
4.0.0-alpha.15 96 2/8/2024
4.0.0-alpha.14 118 1/1/2024
4.0.0-alpha.13 122 12/16/2023
4.0.0-alpha.12 84 12/16/2023
4.0.0-alpha.11 84 12/16/2023
4.0.0-alpha.10 87 12/15/2023
4.0.0-alpha.9 121 11/12/2023
4.0.0-alpha.8 78 11/10/2023
4.0.0-alpha.7 99 4/28/2023
4.0.0-alpha.6 99 4/28/2023
4.0.0-alpha.5 104 4/26/2023
4.0.0-alpha.4 91 4/24/2023
4.0.0-alpha.3 96 4/24/2023
4.0.0-alpha.2 105 4/20/2023
4.0.0-alpha.1 103 4/20/2023
3.0.0-alpha.6 226 12/29/2022
3.0.0-alpha.5 116 12/5/2022
3.0.0-alpha.4 130 10/15/2022
3.0.0-alpha.2 127 10/15/2022
3.0.0-alpha.1 137 10/15/2022
2.0.1-alpha1 201 6/8/2022
2.0.1-alpha.6 128 10/14/2022
2.0.1-alpha.5 132 10/2/2022
2.0.1-alpha.4 144 9/19/2022
2.0.1-alpha.3 128 9/10/2022
2.0.1-alpha.2 152 7/14/2022
2.0.1-alpha.1 152 6/11/2022
2.0.0 552 5/21/2022
0.0.1-alpha.4 151 5/9/2022
0.0.1-alpha.3 144 2/6/2022
0.0.1-alpha.2 164 2/5/2022
0.0.1-alpha.1 162 1/22/2022