Skip to content

Repository files navigation

SonghayCore

Here is the Core code to install as a NuGet package for all of my studio Solutions. Anyone who may be reading this πŸ‘€ is free to do the same. This package is based on net10.0.

NuGet package πŸ“¦: SonghayCore

documentation πŸ“š: SonghayCore API

core reusable, opinionated concerns

Songhay.Hosting

One of the most important additions to .NET came in .NET 6.0 (circa 2021): the .NET Generic Host [πŸ“– docs]. This host concept from Microsoft allows developers to not have to reinvent:

  • Dependency injection (DI)
  • Logging
  • Configuration
  • App shutdown
  • IHostedService implementations (for long-running background tasks πŸ“– docsπŸ”–)

All ASP.NET developers expect to get these things β€œfor free” and, finally, Microsoft is basically letting all .NET developers get these things for free. This Core recognizes the .NET Generic Host, stating with the DefaultHostedService class (see Songhay.Extensions below for more details).

Songhay.Diagnostics

This Core is concerned with tracing as well as logging. Logging concerns should be logically above this Core. TraceSources and TraceSourceExtensions define how tracing should be implemented with a bias toward using all source levels. When tracing is not configured for this Core then it will be ignored without throwing exceptions.

For a review of the organizational difference between tracing and logging, see β€œTracing vs Logging vs Monitoring: What’s the Difference?” by Chrissy Kidd.

Documentation πŸ“š: Songhay.Diagnostics

Songhay.Extensions

The Songhay System uses imperative C# code with a view to make it more functional in an effort to control complexity and enhance maintainability.

The preference for extension methods encourages stateless, reusable routines (many of them are β€œpure” functions).

Notable extensions:

There is support for URI templates (to be used with RestApiMetadata) in the form of extension methods, running on top of Tavis.UriTemplates.

Documentation πŸ“š: Songhay.Extensions

Songhay.Models

The Core models of the Songhay System define types for MIME, XHTML, OPML, REST, the Repository, the Display Item (for WPF and other MVVM solutions), etc.

The Core models are β€œanemic” by design (there are very few abstract classes)β€”any logic would be found first in an Extension Method.

Notable models for the client side:

Selected server-side models:

  • EndpointContentResult β€” defines the result returned from all Web-based, boundary-crossing Activities.
  • ProgramOutputResult β€” defines the general-purpose Result concept of Program completion with output, avoiding third-party dependencies that are not compatible with Fβ™―.
  • StorageObject β€” defines an β€œintersection type” for the S3Object defacto standard and FileInfo.

Documentation πŸ“š: Namespace Songhay.Models

Songhay.Xml

The β€œcore” of the Core is concern for XML. The Songhay System started out as utilities around XPathDocument and grew into LINQ for XMLβ€”over XDocument.

Documentation πŸ“š: Namespace Songhay.Xml

the core Activity concept

This Core features the concept of the Activity which is to be seen in the context of workflow solutions like Windows Workflow Foundation, Durable Task and the dapr Workflow building block. The following abstractions classify the Activities needed so far:

  • IActivity β€” defines the conventional, synchronous, input-output Activities
  • IActivityOutputOnly β€” defines the conventional, synchronous Activities with output only (input usually comes from IConfiguration in this case)
  • IActivityOutputOnlyTask β€” defines the conventional, asynchronous Activities with output only (input usually comes from IConfiguration in this case)
  • IActivityTask β€” defines the conventional, asynchronous, input-output Activities

This Activity concept exists to formally recognize that a Program is a β€˜tree’ of inputs and outputsβ€”the process we are drawing to form an Activity should be shaped like a tree 🌳

satellite packages

SonghayCore.S3

Amazon S3 routines for .NET Core. Outside of the world of the Microsoft cloud (Azure), the rest of the world’s cloud storage is (mostly) standardized around the AWS S3 API. Financial motivations lead one to respect this reality and the following Activities were added for access to S3 storage:

NuGet package πŸ“¦: SonghayCore.S3

Documentation πŸ“š: Namespace Songhay.S3

SonghayCore.Web

Extensions and Handlers for Songhay Web projects. Specifically, this renewed investment in ASP.NET minimal Web API is needed to develop AOT-compiled .NET microservices for OCI-compliant containers.

NuGet package πŸ“¦: SonghayCore.Web

Documentation πŸ“š: Namespace Songhay.Web

SonghayCore.xUnit

Defines reusable class definitions for xUnit. Featured is the ProjectFileDataAttribute, allowing test data files to be loaded from a relative path.

NuGet package πŸ“¦: SonghayCore.xUnit

Documentation πŸ“š: Namespace Songhay.Tests

SonghayCore.Newtonsoft

Core reusable, opinionated Newtonsoft concerns for my C# projects.

GitHub repo: https://github.com/BryanWilhite/SonghayCore.Newtonsoft

NuGet package πŸ“¦: SonghayCore.Newtonsoft

Studio packages dependent on SonghayCore

flowchart BT
    netstandard2[[.NET Standard 2.0]]
    net10[[.NET 10.0]]

    1[SonghayCore πŸ“¦]
    2[SonghayCore.Newtonsoft πŸ“¦πŸ§Š]

    net10-->1
    netstandard2-->2
    2-..->|optional addition|1

    1-->3[SonghayCore.S3 πŸ“¦]
    1-->4[SonghayCore.Web πŸ“¦]
    1-->5[SonghayCore.xUnit πŸ“¦]
    1-->6[Songhay.DataAccess πŸ“¦]
    1-->8[Songhay.Publications]

    3-->7[Songhay.Feeds 🌩]
    4-->7[Songhay.Feeds 🌩]
Loading

Bryan Wilhite is on LinkedInπŸ‡ΊπŸ‡ΈπŸ’Ό

About

core reusable, opinionated concerns for *all* 🧐 of my C# projects

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages