Blueberry.Core.NetStandard
20261119.0.1-alpha
dotnet add package Blueberry.Core.NetStandard --version 20261119.0.1-alpha
NuGet\Install-Package Blueberry.Core.NetStandard -Version 20261119.0.1-alpha
<PackageReference Include="Blueberry.Core.NetStandard" Version="20261119.0.1-alpha" />
<PackageVersion Include="Blueberry.Core.NetStandard" Version="20261119.0.1-alpha" />
<PackageReference Include="Blueberry.Core.NetStandard" />
paket add Blueberry.Core.NetStandard --version 20261119.0.1-alpha
#r "nuget: Blueberry.Core.NetStandard, 20261119.0.1-alpha"
#:package Blueberry.Core.NetStandard@20261119.0.1-alpha
#addin nuget:?package=Blueberry.Core.NetStandard&version=20261119.0.1-alpha&prerelease
#tool nuget:?package=Blueberry.Core.NetStandard&version=20261119.0.1-alpha&prerelease
Welcome to Blueberry
Blueberry is a set of libraries and practices for various tiers of software development (tailored more to business applications than anything else). The main goals behind it:
- Unified development experience
- Following established best practices
- Accelerate the development process
- Minimize the need to reinvent things
Prerequisites
- NetStandard2
- Net4.8 (being deprecated)
flowchart TB
subgraph Blueberry
IRepository --> Repository
subgraph Polyglot
Repository --> ORM
ORM --> NHibernate
ORM --> EF
ORM --> Dapper
Repository --> FileSystem
Repository --> AzureBlobs
Repository --> Git
Repository --> NoSql
NoSql --> Cosmos
NoSql --> AzureTables
NoSql --> Mongo
NoSql --> ColStore
end
subgraph Markers
AbstractMarkers["`
IPublishable
ISequenceable
ISoftDeletable
ITimeStampable
IHierarchical
IDataProtectable`"]
end
subgraph IoC*
IoC <--> DI
IoC <--> Interceptors
IoC <--> Remoting
end
subgraph Domains
AbstractDomains["`
AvailabilityDefinitions
DocProc
Excellency
Finance
Geography
Humanity
Lookups
Masterdata
MessagingCenter
MessageExchange
Metadata
Scheduling
Security
Servicing
StagingProcessing
Studies
Transportation`"]
end
subgraph Microfrontends
TBDMF
end
subgraph Infrastructure
TBDInfra
end
subgraph Apps
Crm
Scheduler
MdsTracker
NanoCms
MoreApps
end
end
subgraph Target Solution
AbstractDomains -- use/inherit from --> Entities
Entities <-- declare --> IRepository
Entities <-- mark --> AbstractMarkers
Database[(Database)] <-- Contract:Entities --> Repositories
Repositories <-- use/inherit from --> Repository
Repostories <-- Contract:Entities --> Business
Business <-- use --> IoC
Entities <--> Business
Business <-- Contract:Dto/Cqrs --> API
API <-- Contract:Dto/Cqrs --> UI
UI(UI) <-- use --> TBDMF
Infrastruscture <-- use --> TBDInfra
end
Entities
Meaning & Guideline
- Solely describes the domain, NOT the behavior
- Must be portable
- Ultimately will transcribe into persistency layer
Rules
Consider
- Avoid any behavior description in entities, those must be nouns with characteristics
- Inheritance over interfaces
- Default empty ctor
Must
- Pure POCO, portable
- Classes must not be sealed
- Properties must be virtual
- All entities to have EntityNameId as primary identifier
- Use ICollection vs IList appropriately
- Use DateOnly vs DateTime vs DateTimeOffset appropriately
- Put only entities for persistency into Domain proj, DO NOT put any DTOs or dataclasses there
Examples
public abstract class Pet //abstract, pets MUST be concrete
{
public Pet(){}//Default ctor
public virtual Guid PetId{get;set;}
public virtual string Name{get;set;}
}
public class Cat: Pet
{
public Cat(){} //Default ctor
public virtual Guid CatId{get;set;}
public virtual bool CanSayMeow{get;set;} //not ideal: implicit, defines behavior and FALSE by default
}
Helper Interfaces
- IPublishable
- ISequenceable
- ISoftDeletable
- ITimeStampable
- IHierarchical
- IDataProtectable
Repositories
Meaning & Guideline
- Implements the "HOW" persistency layer will work
- Assumes upper layer unit of work
- Follows best practice for ORM and exact persistency technology
Rules
- Bare minimum exposure (IRepository vs IListingRepository)
- Use underlying APIs of ORM appropriately
Business Logic
Meaning & Guideline
Rules
Configuration
Blueberry.config
- This is the primary configuration file for the framework
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="blueberry" type="Blueberry.Core.ConfigSections.BlueberrySection, Blueberry.Core.NetStandard" />
</configSections>
<blueberry>
<domain enableDbOrmCommandsCountThresholdAt="5">
<ormConnectionString value="Server=.\sqlexpress;Initial Catalog=equipment;Integrated Security=true;MultipleActiveResultSets=False;Connection Timeout=30;" dbType="Postgresql"/>
<assemblies>
<add name="EquipmentSelection.Domain"></add>
</assemblies>
</domain>
<dtos></dtos>
</blueberry>
</configuration>
Unity.config
- Controls IoC
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Unity.Configuration"/>
</configSections>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<alias alias="UnitOfWorkContract" type="Blueberry.Core.UnitOfWork.IUnitOfWork, Blueberry.Core.NetStandard"/>
<alias alias="UnitOfWorkPersistencyManagerContract" type="Blueberry.Core.UnitOfWork.IUnitOfWorkPersistencyManager, Blueberry.Core.NetStandard"/>
<alias alias="SomeContract" type="Some.IService, Some"/>
<container>
<register type="UnitOfWorkContract" mapTo="Blueberry.Core.Persistency.Orm.NHibernate.OrmUnitOfWork, Blueberry.Core.NetStandard"/>
<register type="UnitOfWorkPersistencyManagerContract" mapTo="Blueberry.Core.UnitOfWork.CallContextUnitOfWorkPersistencyManager, Blueberry.Core.NetStandard"/>
<register type="SomeContract" mapTo="Some.Service, Some"/>
</container>
</unity>
</configuration>
Database Seeding
NHibernate
var schemaManager = new NhibernateSchemaManager();
schemaManager.RecreateCurrentContextSchema();
Using the NuGet package
dotnet add package Blueberry.Core.NetStandard
Targets netstandard2.0 and net10.0.
The package ships unity.config and blueberry.config as content files, copied to your output directory automatically. Register your domain assemblies and connection string in blueberry.config:
<blueberry>
<domain>
<ormConnectionString value="Server=.;Initial Catalog=mydb;Integrated Security=true;" />
<assemblies>
<add name="My.Domain" />
</assemblies>
</domain>
</blueberry>
Do not commit real credentials; inject the connection string from environment or secrets.
Open the unit of work before constructing a repository:
using (var uow = new OrmUnitOfWork())
{
var repo = new MyEntityRepository();
var item = repo.GetById(id);
repo.Update(item);
uow.Commit();
}
Notes:
- On
net10.0RabbitMQ messages are serialized as JSON (BinaryFormatteris unavailable);netstandard2.0still usesBinaryFormatter. - The
_SqlHelpscripts are repository-only and are not packed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Azure.Data.Tables (>= 12.8.2)
- Azure.Messaging.ServiceBus (>= 7.17.0)
- Azure.Storage.Blobs (>= 12.19.1)
- Azure.Storage.Queues (>= 12.17.1)
- Blueberry.Utilities (>= 0.0.2026.123-beta)
- Castle.Core (>= 5.2.1)
- FluentNHibernate (>= 3.4.1)
- LibGit2Sharp (>= 0.28.0)
- Microsoft.Azure.Cosmos (>= 3.37.0)
- Microsoft.SqlServer.Smo.dll (>= 1.0.1)
- Microsoft.SqlServer.SqlManagementObjects (>= 161.46521.71)
- MongoDB.Driver (>= 2.14.1)
- Newtonsoft.Json (>= 13.0.3)
- NHibernate (>= 5.7.0)
- NHibernate.Caches.Redis (>= 2.0.0)
- NHibernate.Spatial (>= 8.0.0)
- NLog (>= 5.2.6)
- Npgsql (>= 8.0.9)
- RabbitMQ.Client (>= 6.2.3)
- StackExchange.Redis (>= 1.2.6)
- System.Data.SqlClient (>= 4.8.6)
- System.ServiceModel.Primitives (>= 4.10.0)
- Unity (>= 5.11.10)
- Unity.Abstractions (>= 5.11.7)
- Unity.Configuration (>= 5.11.2)
- Unity.Interception (>= 5.11.1)
- Unity.RegistrationByConvention (>= 5.11.1)
- YamlDotNet.NetCore (>= 1.0.0)
-
net10.0
- Azure.Data.Tables (>= 12.8.2)
- Azure.Messaging.ServiceBus (>= 7.17.0)
- Azure.Storage.Blobs (>= 12.19.1)
- Azure.Storage.Queues (>= 12.17.1)
- Blueberry.Utilities (>= 0.0.2026.123-beta)
- Castle.Core (>= 5.2.1)
- FluentNHibernate (>= 3.4.1)
- LibGit2Sharp (>= 0.28.0)
- Microsoft.Azure.Cosmos (>= 3.37.0)
- Microsoft.SqlServer.Smo.dll (>= 1.0.1)
- Microsoft.SqlServer.SqlManagementObjects (>= 161.46521.71)
- MongoDB.Driver (>= 2.14.1)
- Newtonsoft.Json (>= 13.0.3)
- NHibernate (>= 5.7.0)
- NHibernate.Caches.Redis (>= 2.0.0)
- NHibernate.Spatial (>= 8.0.0)
- NLog (>= 5.2.6)
- Npgsql (>= 8.0.9)
- RabbitMQ.Client (>= 6.2.3)
- StackExchange.Redis (>= 1.2.6)
- System.Data.SqlClient (>= 4.8.6)
- System.ServiceModel.Primitives (>= 4.10.0)
- Unity (>= 5.11.10)
- Unity.Abstractions (>= 5.11.7)
- Unity.Configuration (>= 5.11.2)
- Unity.Interception (>= 5.11.1)
- Unity.RegistrationByConvention (>= 5.11.1)
- YamlDotNet.NetCore (>= 1.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Blueberry.Core.NetStandard:
| Package | Downloads |
|---|---|
|
Blueberry.BddExtensions
Blueberry BddExtensions |
|
|
Blueberry.BddExtensions.NetStandard
Blueberry BddExtensions |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 20261119.0.1-alpha | 37 | 11/20/2026 |
| 20261031.0.1-alpha | 150 | 10/31/2026 |
| 20260717.0.1-alpha | 354 | 7/17/2026 |
| 20260716.0.1-alpha | 210 | 7/16/2026 |
| 20260709.0.1-alpha | 211 | 7/8/2026 |
| 20260123.0.1-alpha | 636 | 1/23/2026 |
| 20251006.0.1-alpha | 332 | 10/7/2025 |
| 20250926.0.1-alpha | 273 | 9/26/2025 |
| 20250719.0.3-alpha | 445 | 9/4/2025 |
| 20250719.0.2-alpha | 676 | 9/4/2025 |
| 20250719.0.1-alpha | 669 | 9/4/2025 |
| 20250219.0.0-alpha | 297 | 2/19/2025 |
| 20250113.0.2-alpha | 1,242 | 1/13/2025 |
| 20250113.0.1-alpha | 580 | 1/13/2025 |
| 20250113.0.0-alpha | 631 | 1/13/2025 |
| 20250107.0.1-alpha | 820 | 1/7/2025 |
| 20250107.0.0-alpha | 218 | 1/6/2025 |
| 20241015.0.2-alpha | 241 | 1/6/2025 |
| 20241015.0.1-alpha | 205 | 1/6/2025 |
| 1.0.0 | 446 | 10/2/2024 |
CallContextUnitOfWorkPersistencyManager keeps each request's unit of work in its own async flow: one request ending its unit of work no longer drops the unit of work of every other request in flight (NullReferenceException in OrmRepository.List/GetById)