Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

missing PerRequestLifetimeManager in Unity.AspNet.WebApi #10

Open
laksh-parab opened this issue Apr 18, 2018 · 1 comment
Open

missing PerRequestLifetimeManager in Unity.AspNet.WebApi #10

laksh-parab opened this issue Apr 18, 2018 · 1 comment
Assignees
Labels
Enhancement 🔨 Improvement of existing features

Comments

@laksh-parab
Copy link

laksh-parab commented Apr 18, 2018

When using Unity with ASP.NET Web API project i added the following packages

  <package id="Unity" version="5.8.5" targetFramework="net471" />
  <package id="Unity.Abstractions" version="3.3.0" targetFramework="net471" />
  <package id="Unity.AspNet.WebApi" version="5.0.13" targetFramework="net471" />
  <package id="Unity.Container" version="5.7.0" targetFramework="net471" />
  <package id="WebActivatorEx" version="2.2.0" targetFramework="net471" />

However, I can not use PerRequestLifetimeManager because it is not part of Unity.AspNet.WebApi. Instead PerRequestLifetimeManager is part of Unity.Mvc. and when Unity.Mvc Nuget package is added to Web Api Project it brings in other Web UI related dependencies like

Microsoft.AspNet.Razor
Microsoft.AspNet.WebPages
Microsoft.AspNet.Mvc

Is there a way to use PerRequestLifetimeManager in ASP.NET Web API without adding Unity.Mvc package?

@ENikS
Copy link
Contributor

ENikS commented Apr 18, 2018

Just copy implementation of the manager and use it in your code.

@ENikS ENikS closed this as completed Apr 18, 2018
@ENikS ENikS reopened this Apr 18, 2018
@ENikS ENikS self-assigned this Jan 29, 2019
@ENikS ENikS added the Enhancement 🔨 Improvement of existing features label Jan 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement 🔨 Improvement of existing features
Projects
None yet
Development

No branches or pull requests

2 participants