Code Monkey home page Code Monkey logo

grace's Introduction

Grace

Grace is a feature rich Dependency Injection Container designed with ease of use and performance in mind.

   using Grace.DependencyInjection;

   var container = new DependencyInjectionContainer();

   container.Configure(c => c.Export<BasicService>().As<IBasicService>());

   var basicService = container.Locate<IBasicService>();

It's as easy as create, configure, and locate.

Getting Grace

NuGet package supports .Net 4.5 and .Net Standard 1.0.

Getting Started - A getting started guide for Grace as well as documentation for more complex topics

Features in Grace

  • Fluent interface or Attributes for configuration allowing for maximum flexibility
  • Supports child containers and light weight lifetime scopes
  • Contextual binding support (similar to NInject)
  • IDisposable objects created by the container will be tracked and disposed by the container unless configured otherwise.
  • Performance characteristics that make it one of the fastest containers available. (Benchmarks)
  • Supports special types
    • IEnumerable<T> - supports resolving collections as IEnumerable<T> as well as most other types of collections List<T>, ReadOnlyCollection<T>, T[] and any collection that implements ICollection<T>
    • Func<T> - supports resolving Func<T> automatically
    • Lazy<T> - when resolved a Lazy<T> will be created that resolves T from the scope it was created in
    • Owned<T> - object resolved within a Owned<T> will have their disposal lifecycle tied to the Owned<T> (similar to autofac)
    • Meta<T> - objects resolved within a Meta<T> are resolved along with their metadata
    • Custom Delegates - any delegate that returns a type can be automatically resolved.
    • Custom interface factories with Grace.Factory
  • Many LifeStyles supported including Singleton, SingletonPerScope, SingletonPerRequest (MVC4, MVC5 & WCF packages), SingletonPerObjectGraph, SingletonPerAncestor<T>, and WeakSingleton. If none of the provided life styles meet your need you can always implement your own ICompiledLifeStyle class.
  • Built in support for the decorator pattern
  • Support for custom wrappers (Func<T> and Meta<T> are examples of built in wrappers)
  • ASP.Net Core support
  • ASP.Net MVC 4 & 5 support

Build status Build Status Coverage Status

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.