GoldenEye is a library that brings you abstractions and implementations for common topics. It is written in .NET Core. It provides set of base and bootstrap classes that helps you to reduce boilerplate code and help you focus on writing business code.
Complete DDD and CQRS helpers and bootstrap for:
- Command definition and handling
- Queries definition and handling
- Events definition, publishing and handling
- Aggregates definition
- Registration helpers to reduce boilerplate
- Validation helpers for commands and queries
- CRUD Repositories
- CRUD Services
- Entities definition
- General:
- Collections:
- Dependency Injection Registration
- Dynamic
- Enums
- Exceptions
- Lambda
- Auto Mapper mappings
- Convention names
- Reflection
- Serialization
- Streams
- Assemblies Provider
- Fluent Switch statement
- Collection to CSV Converter
- String Encryption
- Exceptions formatter
- Exceptions formatter
- Guards for defensive programming
- PropertyName
- Localization Utils
- Localized DisplayName Attribute
- Localized DisplayName Attribute
- Simple MessageBus
- NoSynchronizationContextScope
To make easier dependency resolution inside library package GoldenEye
provides prossibility to define modules.
Thanks for that you don't need to remember to register everything in runtime assembly. You can just AddModule
and rest will be done automatically.
To define module you need to implement IModule
interface.
public class CustomModule: IModule
{
public virtual void Configure(IServiceCollection services)
{
services.AddScoped<SomeDbContext>();
}
public virtual void Use()
{
service.UseSomething();
}
}
or derive from Module
class and override only what you need:
public class CustomModule: Module
{
public override void Configure(IServiceCollection services)
{
services.AddScoped<SomeDbContext>();
}
}
Then in your startup class call AddModule
and UseModules
extension methods:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddModule<CustomModule>();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseModules(env);
}
}
You can also add all of your defined modules by calling AddAllModules
extension method:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAllModules();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseModules(env);
}
}
Create new project and add nuget package:
dotnet add package GoldenEye
You can either go and check Sample project, Install the project template by running
dotnet new -i GoldenEye.WebApi.Template.SimpleDDD
and then create new project based on it:
dotnet new SimpleDDD -n NameOfYourProject
Or manually add packages to your project, eg: create new project and add nuget package:
dotnet add package GoldenEye
You can also check my Github Tutorial about CQRS and Event Sourcing.
Feel free to create an issue on GitHub. Contributions, pull requests are more than welcome!
For detailed list of changes see Changelog
GoldenEye is Copyright © 2015-2020 Oskar Dudycz and other contributors under the MIT license.