Git Product home page Git Product logo

dotnetdynamicinjector's Introduction

DotNet.DynamicInjector

Dynamic dependency injector for external project DLLs

Dynamically reference external dlls without the need to add them to the project. Leave your project with low dependency and allowing specific dlls according to your business rule or database parameters.

This is the component, works on .NET Core and.NET Framework

Info

Code Quality Build Nuget Contributors
Codacy Badge Build NuGet GitHub contributors

Platform Support

DotNet.DynamicInjector is a .NET Standard 2.0 library.

Using DynamicInjector

The dlls that should be referenced by default must be in the compiled project folder

Use the service configuration in the startup of your ASP.NET core project

services.RegisterDynamicDependencies(ioCConfiguration);

IoCConfiguration contains the configuration of your dependency injection. It is possible to specify only the namespaces you want to reference, ignoring others in the project

var ioCConfiguration = new IoCConfiguration()
{
   AllowedInterfaceNamespaces = 
       new List<string> {"Mynamespance1", "Mynamespance2"}
};

IoCRole configures the dll and type of dependency you want to automatically inject

var role = new IoCRole
 {
     Dll = "MyProject.dll", //DLL name
     Implementation = "My Implementation", // Implementation name, can be used for a control if you use several projects and wanted to separate them
     Priority = 1, // Priority that the dll should be loaded
     LifeTime = LifeTime.SCOPED, // Lifetime of your addiction injection
    Name = "My client business rule x" //Dependency name. It is used only for identification
  };
            
    ioCConfiguration.Roles.Add(role);

Samples coming soon ..

dotnetdynamicinjector's People

Contributors

andreluizsecco avatar codacy-badger avatar tbertuzzi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.