Blueberry.Core.NetStandard 20261119.0.1-alpha

This is a prerelease version of Blueberry.Core.NetStandard.
dotnet add package Blueberry.Core.NetStandard --version 20261119.0.1-alpha
                    
NuGet\Install-Package Blueberry.Core.NetStandard -Version 20261119.0.1-alpha
                    
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="Blueberry.Core.NetStandard" Version="20261119.0.1-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blueberry.Core.NetStandard" Version="20261119.0.1-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Blueberry.Core.NetStandard" />
                    
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 Blueberry.Core.NetStandard --version 20261119.0.1-alpha
                    
#r "nuget: Blueberry.Core.NetStandard, 20261119.0.1-alpha"
                    
#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 Blueberry.Core.NetStandard@20261119.0.1-alpha
                    
#: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=Blueberry.Core.NetStandard&version=20261119.0.1-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Blueberry.Core.NetStandard&version=20261119.0.1-alpha&prerelease
                    
Install as a Cake Tool

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

  1. Solely describes the domain, NOT the behavior
  2. Must be portable
  3. Ultimately will transcribe into persistency layer

Rules

Consider
  1. Avoid any behavior description in entities, those must be nouns with characteristics
  2. Inheritance over interfaces
  3. Default empty ctor
Must
  1. Pure POCO, portable
  2. Classes must not be sealed
  3. Properties must be virtual
  4. All entities to have EntityNameId as primary identifier
  5. Use ICollection vs IList appropriately
  6. Use DateOnly vs DateTime vs DateTimeOffset appropriately
  7. 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

  1. Implements the "HOW" persistency layer will work
  2. Assumes upper layer unit of work
  3. Follows best practice for ORM and exact persistency technology

Rules

  1. Bare minimum exposure (IRepository vs IListingRepository)
  2. 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.0 RabbitMQ messages are serialized as JSON (BinaryFormatter is unavailable); netstandard2.0 still uses BinaryFormatter.
  • The _SqlHelp scripts are repository-only and are not packed.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

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)