Git Product home page Git Product logo

invio.extensions.dependencyinjection's People

Contributors

carusology avatar rokadias avatar

Watchers

 avatar

invio.extensions.dependencyinjection's Issues

Update Travis CI to use .NET Core v1.1

Travis CI has not yet been updated to use .NET Core v1.1. Code coverage and deployment is performed via appveyor, so it is not a blocking issue. However, we will not be testing to make sure the library works on Linux / Mac OS X with Mono or .NET Core.

The underlying issue from Travis CI is here.

Add "Named" Services Registrations

One of the major qualms I have had with the Microsoft dependency injection implementation is that it has a one-type / one-registration policy. If I have two implementations of IFoo, I cannot register them both simultaneously. Instead, I need to recreate them every time I need them.

StructureMap, because it is not terrible, uses the concept of "named" registrations to get around this problem. When you register an implementation of a service to an interface, you can "name" that registration with a string.

We could add this functionality to the Microsoft implementation by creating some kind of disposable dictionary of type IDictionary<string, TValue>. For each registration of TValue, we require a name, and stick it in the dictionary. Then, when the dictionary should be disposed, it disposes all of the TValue implementations that are IDisposable.

I could envision it looking something like the following:

services.AddNamedScoped<TService, TImplementation>("Name");
services.AddNamedSingleton<TService>(typeof(TImplementation), "Name");
services.AddNamedTransient(typeof(TService), Func<IServiceProvider, TImplementation>, "Name");

Behind the scenes, this would either create or update a dictionary that had a mapping of names to services that was managed by the Microsoft service provider. When the dictionary would be disposed in accordance to its scope, it disposes its values.

Update CI to use Solutions & Portable DebugTypes

Background
As part of our migration to v1.0.4 of the .NET SDK, I set the DebugType to full and updated the CI scripts to explicitly reference XML-based *.csproj files due to the removal of global.json and project.json. The DebugType really should be portable for .NET Core when we pack the code (though it needs to be full for when we run opencover on it), and we should add a *.sln to manage our *.csproj files.

Task

  • Update the repository to have a Invio.Extensions.DependencyInjection.sln solution at the root of the repository that references the source and test projects.
  • Update Invio.Extensions.DependencyInjection.csproj such that <IsPackable>false</IsPackable> is specified.
  • Restore set-debug-type.ps1, but with it updating the DebugType via the XML-based Invio.Extensions.DependencyInjection.csproj instead of JSON-based project.json.

Convert to .NET SDK v1.0.4

The Invio.Extensions.DependencyInjection library is using the old project.json format to define its dependencies. We need to migrate it to Invio.Extensions.DependencyInjection.csproj.

Add ability to use open generics with factory pattern

Based upon my research and the results of this stackoverflow question, it does not appear to be possible to use the factory pattern with Microsoft's built in dependency injection pattern. I need to support something like this:

services.AddWithFactory(
    new Type[] { Foo, Bar },
    typeof(IRepository<>),
    typeof(IRepositoryFactory<>),
    ServiceLifetime.Singleton
);

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.