Cloudey.Reflex.Core
1.0.4
Prefix Reserved
See the version list below for details.
dotnet add package Cloudey.Reflex.Core --version 1.0.4
NuGet\Install-Package Cloudey.Reflex.Core -Version 1.0.4
<PackageReference Include="Cloudey.Reflex.Core" Version="1.0.4" />
paket add Cloudey.Reflex.Core --version 1.0.4
#r "nuget: Cloudey.Reflex.Core, 1.0.4"
// Install Cloudey.Reflex.Core as a Cake Addin #addin nuget:?package=Cloudey.Reflex.Core&version=1.0.4 // Install Cloudey.Reflex.Core as a Cake Tool #tool nuget:?package=Cloudey.Reflex.Core&version=1.0.4
Reflex
Core
An opinionated framework setup for common functionality.
Installation
Install with NuGet
For a quick start, use the AddReflexCore
extension method on the host builder. This will register the logging, configuration, caching, validation, Autofac, and common ASP.NET Core services.
// Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.AddReflexCore();
Git
Add the following to your .gitignore
file to ignore local configuration files:
**/appsettings.Local.*
**/appsettings.*.Local.*
Including assemblies
Reflex makes extensive use of assembly scanning to discover types. You should mark your assemblies with the IncludeAssembly
attribute to ensure they are included in the scanning process.
// Anywhere in the assembly
[assembly: IncludeAssembly]
Configuration
Usage
// Program.cs
var builder = WebApplication.CreateBuilder(args);
// ...
builder.AddReflexConfiguration(); // <-- Register configuration
Configuration files
Important: YAML files on the same level always take precedence over JSON files. It is highly recommended to use YAML files exclusively.
I.e. if you have both appsettings.json
and appsettings.yaml
in the same directory, the YAML file will be used.
If you have appsettings.yaml
and appsettings.Development.json
, the JSON file will be used in development.
Precedence - from highest to lowest:
APP__
environment variablesappsettings.{Environment}.Local.yaml
appsettings.{Environment}.Local.json
appsettings.{Environment}.yaml
appsettings.{Environment}.json
appsettings.Local.yaml
appsettings.Local.json
appsettings.yaml
appsettings.json
Sentry
To enable Sentry, configure the DSN in your application settings (preferably in a .Local.yaml file):
Sentry:
Dsn: YourSentryDsnFromSentryDashboard
Then enable logging:
// Program.cs
var builder = WebApplication.CreateBuilder(args);
// ...
builder.AddReflexLogging();
Logging
This package includes integration with Serilog and Sentry for logging.
Enable logging with:
// Program.cs
var builder = WebApplication.CreateBuilder(args);
// ...
builder.AddReflexLogging();
You can configure the logging level with the configuration key Logging.Level
.
Made by
License
Licensed under Apache 2.0.
Copyright © 2023 Cloudey IT Ltd
Cloudey® is a registered trademark of Cloudey IT Ltd. Use of the trademark is NOT GRANTED under the license of this repository or software package.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Autofac (>= 7.0.0)
- Autofac.Extensions.DependencyInjection (>= 8.0.0)
- FluentValidation (>= 11.6.0)
- FluentValidation.AspNetCore (>= 11.3.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.6.0)
- morelinq (>= 3.0.0)
- NetEscapades.Configuration.Yaml (>= 3.0.0)
- Opw.HttpExceptions.AspNetCore (>= 4.0.0)
- Sentry (>= 3.34.0)
- Sentry.AspNetCore (>= 3.34.0)
- Sentry.Serilog (>= 3.34.0)
- Serilog (>= 2.11.0)
- Serilog.AspNetCore (>= 6.1.0)
- Serilog.Enrichers.Environment (>= 2.2.0)
- Serilog.Exceptions (>= 8.4.0)
- Serilog.Exceptions.EntityFrameworkCore (>= 8.4.0)
- Serilog.Extensions.Autofac.DependencyInjection (>= 5.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Cloudey.Reflex.Core:
Package | Downloads |
---|---|
Cloudey.Reflex.Database
Provides an opinionated setup for Entity Framework Core using a PostgreSQL database. See README for usage instructions. |
|
Cloudey.Reflex.GraphQL
Provides an opinionated GraphQL server setup for the Reflex framework. See README for usage instructions. |
GitHub repositories
This package is not used by any popular GitHub repositories.