GithubHelp home page GithubHelp logo

bubdm / unity.webapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devtrends/unity.webapi

0.0 0.0 0.0 868 KB

Unity.WebAPI is a library that allows the simple integration of Microsoft's Unity IoC container with ASP.NET Web API.

License: MIT License

C# 76.59% Batchfile 0.72% Pascal 22.69%

unity.webapi's Introduction

Unity.WebAPI

Unity.WebAPI is a library that allows the simple integration of Microsoft's Unity IoC container with ASP.NET Web API.

Getting started with Unity.WebAPI

The easiest way to add Unity.WebApi to your project is via the NuGet package. You can search for unity.webapi using the GUI or type the following into the package manager console in Visual Studio:

install-package Unity.WebApi

Once installed, just add a call to UnityConfig.RegisterComponents() in the Application_Start method of Global.asax.cs and the Web API framework will then use the Unity.WebAPI DependencyResolver to resolve your components.

e.g.

public class WebApiApplication : System.Web.HttpApplication
{
  protected void Application_Start()
  {
    AreaRegistration.RegisterAllAreas();
    UnityConfig.RegisterComponents();                           // <----- Add this line
    GlobalConfiguration.Configure(WebApiConfig.Register);
    FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    BundleConfig.RegisterBundles(BundleTable.Bundles);
  }           
}  

Add your Unity registrations in the RegisterComponents method of the UnityConfig class. All components that implement IDisposable should be registered with the HierarchicalLifetimeManager to ensure that they are properly disposed at the end of the request.

More Information

You can find out more about what has changed in this release by visiting the DevTrends Blog.

unity.webapi's People

Contributors

brianvallelunga avatar devtrends avatar enosrecanati avatar yazgoo 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.