Nabu.Data 1.4.0


Nabû: Standardizing .NET developments with abstractions

.Net C# apache2-license CI Status


Nabû is an open-source suite of libraries designed to organize and standardize .NET applications development through streamlined interactions. The suite is divided into three (for now) components:

  • Nabu.Core: Provides inversion of control (IoC) helpers that streamline services registration by using attribute tagging.
  • Nabu.Data: Provides data manipulation abstraction, encompassing CRUD operations and sophisticated querying using LinQ.
  • Nabu.Storage: Provides standardized file manipulation abstractions, catering to local, remote, and cloud-based files.

Latest packages

Core Nuget
Data Nuget Data.EntityFramework Nuget Data.LiteDb Nuget
Storage Nuget Storage.Local Nuget Storage.Minio Nuget

Installation

Before installing Nabû, make sure to add the custom NuGet source to your configuration.
Open a terminal or command prompt and run the following command:

dotnet nuget add source "https://nuget.kworld.dev/v3/index.json" -n "kworld NuGet"

Now you can install the various components of Nabû with the following commands:

# Nabu.Core
dotnet add package my_awesome_project.csproj Nabu.Core

# Nabu.Data
dotnet add package my_awesome_project.csproj Nabu.Core --version 1.0.0-alpha
dotnet add package my_awesome_project.csproj Nabu.Data.EntityFramework --version 1.0.0-alpha # For EntityFramework implementation
dotnet add package my_awesome_project.csprojNabu.Data.LiteDb --version 1.0.0-alpha# For LiteDB implementation

# Nabu.Storage
dotnet add package my_awesome_project.csproj Nabu.Storage --version 1.0.0-alpha
dotnet add package my_awesome_project.csproj Nabu.Storage.Local --version 1.0.0-alpha # For local storage
dotnet add package my_awesome_project.csproj Nabu.Storage.Minio --version 1.0.0-alpha # For Minio (Amazon S3) storage

Getting started

Automatic Service Discovery

Nabu.Core introduces automatic service discovery. By tagging interfaces and classes with attributes, the ServiceHelper dynamically finds and uses implementations for services.

Usage


// Example of using attribute ServiceAttribute for service registration
[Service]
public interface IMyService
{
    void DoSomething();
}

public class MyService : IMyService
{
    public void DoSomething()
    {
        // Implementation details
    }
}

public class Main
{
    public void ConfigureServices()
    {
        ServiceHelper serviceHelper = new();
        
        //by using serviceHelper.Context it's possible to precise
        //in wich assemblies or type collections search for implementations and definitions
        //by default it will search in AppDomain.GetAssemblies() (beware lazy-loading !)
        Assembly[] servicesImplementationsAssemblies =
        {
            typeof(MyService).Assembly,
        };
        serviceHelper.Context.WhiteListedDefinitionsTypes.Add(typeof(IMyService));
        serviceHelper.Context.ImplementationsAssemblies.AddRange(servicesImplementationsAssemblies); 
        
        
        //Launch the search of service definitions and theirs implement and then register them.
        serviceHelper.RegisterServices();
        
        using IServiceRegisterProvider provider = ServiceRegistry.BuildServiceProvider();
        
       
        IMyService? service = provider.GetService<IMyService>();
        service.DoSomething();
    }
}

IDao: Data manipulation Interface

Nabu.Data provide the IDao interface in order to standardize data CRUD.

Usage


public class User : IEntity
{
    public string Id { get; set; } = Guid.NewGuid().ToString();
    public DateTime Creation { get; set; } = DateTime.UtcNow;
    public DateTime Update { get; set; } = DateTime.UtcNow;
    
    public string? Name { get; set; }
    public int Age { get; set; }
    
    public List<Car> Cars { get; set; } = new();
}


public class Car : IEntity
{
    public string Id { get; set; } = Guid.NewGuid().ToString();
    public DateTime Creation { get; set; } = DateTime.UtcNow;
    public DateTime Update { get; set; } = DateTime.UtcNow;

    public string? Imatriculation { get; set; }
    public string? Model { get; set; }
    
    [ForeignKey("OwnerId")]
    public User? Owner {get;set;}
    public string? OwnerId { get; set; }
}

public class Main
{
    public async Task ExempleMethod()
    {
        ServiceHelper serviceHelper = new();
        //Configuration
        //...
        await using IServiceRegisterProvider provider = ServiceRegistry.BuildServiceProvider();
        await using IServiceRegistryScope scope = provider.CreateAsyncScope();
        await using IServiceRegisterProvider scopeProvider = scope.ServiceProvider;
        
        IDao? dao = scopeProvider.GetService<IDao>();
        
        
        User cosette = new() { Name = "Cosette", Age = 25 };
        User jean = new() { Name = "Jean Valjean", Age = 55 };
        
        cosette = await dao.AddAsync(cosette);
        jean = await dao.AddAsync(jean);
        
        Car car = new() { Imatriculation = $"CCC-BBB-1", OwnerId = null};
        await dao.AddAsync(car);
        
        Car car2 = new() { Imatriculation = $"CCC-BBB-2", OwnerId = cosette.Id};
        await dao.AddAsync(car2);
        
        car.OwnerId = cosette.id;
        await dao.UpdateAsync(car);
        
        ISpecification<Car> carSpecification = new Specification<Car> { Criteria = c => c.OwnerId == cosette.Id };
        carSpecification.OrderBy(c => c.Creation).ThenBy(c => c.Update);
        
        var dbCars = await dao.ListAllAsync(carSpecification);
        
    }
}


Documentation

For comprehensive insights into the capabilities and nuances of Nabû, refer to the official documentation:

Documentation Link

Contributing

Join us in enhancing Nabû! We welcome contributions in the form of suggestions, bug reports, and pull requests. Check out the Contribution Guidelines to get involved.

License

This project operates under the Apache 2.0 License. For more details, refer to the LICENSE file.

Why "Nabû" ?

Nabû (Akkadian: cuneiform: 𒀭𒀝) is the name of and old Mesopotamian God.
In ancient cultures, Nabû was revered as a deity associated with wisdom, scholarship, and the recording of informations. Nabû's symbols included a stylus resting on a tablet.

By adopting those name and symbols, this suite of libraries refers, in a cool way, to the the art of writing and recording of informations.

Showing the top 20 packages that depend on Nabu.Data.

Packages Downloads
BotWorker.Nabu
Package Description
8,845
BlazorParameter.Commons
Package Description
4,209
BlazorParameter.Commons
Package Description
4,145
Armony.Utilisateurs.Models
Package Description
2,915
Armony.Abstractions
Package Description
2,910
Armony.Communs.Models
Package Description
2,904
com.specidev.lib.parametrages.Commons
Package Description
2,633
Armony.Notifications.Models
Package Description
2,068
Nabu.Data.EntityFramework
Package Description
2,026
Nabu.Data.EntityFramework
Package Description
1,888
Nabu.Data.EntityFramework
Package Description
1,805
BlazorParameter.Commons
Package Description
1,767
BotWorker.Nabu
Package Description
1,679
Nabu.Data.EntityFramework
Package Description
1,637
Nabu.Data.EntityFramework
Package Description
1,592
Nabu.Data.HealthCheck
Package Description
1,567
Nabu.Data.EntityFramework
Package Description
1,540
Nabu.Data.HealthCheck
Package Description
1,532
Nabu.Data.HealthCheck
Package Description
1,524
Nabu.Data.EntityFramework
Package Description
1,497

Add functional thenby on list includes

.NET 5.0

.NET 6.0

.NET 8.0

Version Downloads Last updated
3.5.0 850 11/12/2025
3.5.0-rc2 227 11/05/2025
3.4.0 4,371 07/18/2025
3.3.7 206 07/09/2025
3.3.6 2,724 06/30/2025
3.3.5 1,082 05/20/2025
3.3.4 462 05/15/2025
3.3.3 5,105 04/09/2025
3.3.2 10,573 03/13/2025
3.3.1 2,528 03/05/2025
3.3.0 487 03/05/2025
3.2.2 4,287 12/29/2024
3.2.1 17 12/28/2024
3.2.0 513 12/28/2024
3.1.0 1,193 12/11/2024
3.0.2 2,455 12/09/2024
3.0.1 2,217 11/26/2024
2.2.3 5,170 08/23/2024
2.2.1 589 08/21/2024
2.2.0 18 08/21/2024
2.1.0 99 07/31/2024
2.0.0 663 06/10/2024
1.5.0 471 05/28/2024
1.4.1 373 05/16/2024
1.4.0 17 05/15/2024
1.4.0-beta 19 03/05/2024
1.3.0 1,587 03/29/2024
1.2.0 148 03/29/2024
1.1.0 19 03/29/2024
1.0.0.1 18 03/29/2024