All Projects → lawrence-laz → Decor.NET

lawrence-laz / Decor.NET

Licence: MIT license
A simple way to decorate a class with additional functionality using attributes.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Decor.NET

Platform Compat
Roslyn analyzer that finds usages of APIs that will throw PlatformNotSupportedException on certain platforms.
Stars: ✭ 250 (+762.07%)
Mutual labels:  netcore, netstandard
Cauldron
C# Toolkit
Stars: ✭ 68 (+134.48%)
Mutual labels:  netcore, aop
SharpAudio
Audio playback/capturing engine for C#
Stars: ✭ 139 (+379.31%)
Mutual labels:  netcore, netstandard
Swan
Swan stands for Stuff We All Need. Unosquare's collection of C# extension methods and classes.
Stars: ✭ 202 (+596.55%)
Mutual labels:  netcore, netstandard
dark-sky-core
A .NET Standard Library for using the Dark Sky API.
Stars: ✭ 55 (+89.66%)
Mutual labels:  netcore, netstandard
Opentouryo
”Open棟梁”は、長年の.NETアプリケーション開発実績にて蓄積したノウハウに基づき開発した.NET用アプリケーション フレームワークです。 (”OpenTouryo” , is an application framework for .NET which was developed using the accumulated know-how with a long track record in .NET application development.)
Stars: ✭ 233 (+703.45%)
Mutual labels:  netcore, netstandard
DjvuNet
DjvuNet is a cross platform fully managed .NET library for working with Djvu documents which can run on Linux, macOS and Windows. Library has been written in C# and targets .NET Core v3.0 and .NET Standard v2.1 or later. We intend to provide DjVu document processing capabilities on par with DjVuLibre reference library (or even better).
Stars: ✭ 54 (+86.21%)
Mutual labels:  netcore, netstandard
Megaapiclient
MegaApiClient is a C# .Net library to access http://mega.co.nz / http://mega.nz cloud storage and file hosting service.
Stars: ✭ 151 (+420.69%)
Mutual labels:  netcore, netstandard
Kendo.DynamicLinqCore
KendoNET.DynamicLinq implements server paging, filtering, sorting, grouping, and aggregating to Kendo UI via Dynamic Linq for .Net Core App(1.x ~ 3.x).
Stars: ✭ 36 (+24.14%)
Mutual labels:  netcore, netstandard
NCop
Composite-aspect oriented framework for .NET
Stars: ✭ 30 (+3.45%)
Mutual labels:  aop, aspect-oriented-programming
Oxyplot
A cross-platform plotting library for .NET
Stars: ✭ 2,466 (+8403.45%)
Mutual labels:  netcore, netstandard
DotNetGraph
Create GraphViz DOT graph with .NET / C#
Stars: ✭ 57 (+96.55%)
Mutual labels:  netcore, netstandard
Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
Stars: ✭ 162 (+458.62%)
Mutual labels:  netcore, netstandard
Standard.licensing
Easy-to-use licensing library for .NET Framework, Mono, .NET Core, and Xamarin products
Stars: ✭ 239 (+724.14%)
Mutual labels:  netcore, netstandard
Ffmediatoolkit
FFMediaToolkit is a cross-platform video decoder/encoder library for .NET that uses FFmpeg native libraries. It supports video frames extraction, reading stream metadata and creating videos from bitmaps in any format supported by FFmpeg.
Stars: ✭ 156 (+437.93%)
Mutual labels:  netcore, netstandard
Norns
dotnet core aop static weaving on roslyn
Stars: ✭ 23 (-20.69%)
Mutual labels:  netcore, aop
Activelogin.authentication
Support Swedish BankID (svenskt BankID) authentication in .NET.
Stars: ✭ 141 (+386.21%)
Mutual labels:  netcore, netstandard
Fluentdispatch
🌊 .NET Standard 2.1 framework which makes easy to scaffold distributed systems and dispatch incoming load into units of work in a deterministic way.
Stars: ✭ 152 (+424.14%)
Mutual labels:  netcore, netstandard
Autofac.Configuration
Configuration support for Autofac IoC
Stars: ✭ 35 (+20.69%)
Mutual labels:  netcore, netstandard
NETProvider
Firebird ADO.NET Data Provider
Stars: ✭ 113 (+289.66%)
Mutual labels:  netcore, netstandard

Decor.NET

NuGet Version NuGet Downloads GitHub Action Status Codacy Badge Codacy Badge

🚧 Notes on version 3.0 🚧

With the introduction of source generators in C#, Decor will undergo major changes with significant improvements. Big part of dynamic code will be transformed into compile time source generators.

What does this mean for you?

If you are currently using Decor V2, you can continue using it with no problems. Once V3 is available you will have to make a decision to either stay with V2, or update your code to V3. No new features will be added to V2, but in case of significant bugs they will be addressed. All further development of Decor will be performed on V3.

What does this package do?

This package provides a nice and simple way to execute any code before and after any other method. This is particularly useful for things like: logging, profiling, retry logic, caching, etc.

[Decorate(typeof(LoggingDecorator))]
void DoWork() 
{
    Console.WriteLine("Working...");
}
public class LoggingDecorator : IDecorator
{    
    public async Task OnInvoke(Call call)
    {
        Console.WriteLine("Will do some work!");
        await call.Next();
        Console.WriteLine("Work is finished!");
    }
}
Output is:
    Will do some work!
    Working...
    Work is finished!

How to get started?

There are two ways to use this library:

  1. With Microsoft.DependencyInjection
  2. Without dependency injection

With Microsoft dependency injection

  1. Install the main package and Microsoft DependencyInjection integration:

    PS> Install-Package Decor.Extensions.Microsoft.DependencyInjection
  2. Create a decorator YourDecorator implementing IDecorator interface.

  3. Add [Decorate(typeof(YourDecorator))] attributes to SomeService class' methods to be decorated.

  4. Register to dependency container:

    services
        .AddScoped<SomeService>()
        .AddTransient<YourDecorator>() // Transient means decorator will inherit target's lifetime.
        .Decorate<SomeService>(); 

Without dependency injection

  1. Install the main package:

    PS> Install-Package Decor
  2. Create a decorator implementing IDecorator interface.

  3. Add [Decorate(typeof(YourDecorator))] attributes to methods to be decorated.

  4. Create decorated objects using Decorator class:

    var service = new SomeService();
    var decoratedService = new Decorator().For(service);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].