Data dodania Pytanie
2018-02-12 10:02 Using Autofac in integration tests with web api 2 »
I have been manually instantiating my services in my integration tests, but when I got to a serve that had Lazy dependencies, I did some research and ...
(1) odpowiedzi
2018-02-09 13:02 .NET Core 2.0 Autofac Register Class InstancePerRequest doesn't work »
Here is my interface public interface IMatchServices { string MatchList(); } and class here public class MatchServices : IMatchServices { ...
(1) odpowiedzi
2018-01-17 14:01 Covariant service resolution by IoC container »
I'm using dependency injection pattern for my application without any IoC Container. Now I decided to use some IoC Container because my Composition Ro...
(1) odpowiedzi
2018-01-06 21:01 SignalR Dependency Injection for ASP.NET Core v2.0 using Autofac »
Is it possible to use dependency injection to inject dependencies into SignalR on ASP.NET Core v2.0? Assuming the following hub and dependency: publ...
(1) odpowiedzi
2017-12-21 10:12 Is it possible to change lifetime scope during runtime? »
I'm using Autofac in my WebApi project and till now everything has worked fine. For example, I register: builder.Register(x => new LogService()) ...
(0) odpowiedzi
2017-10-25 04:10 ASP.NET Core 2.0 with Autofac, type not assignable to service »
I simply cannot figure this out. Using Autofac with .Net core 2.0 and trying to resolve some simple dependencies. Feel like I've tried everything so m...
(1) odpowiedzi
2017-10-24 19:10 Web API Controller not found when class is generic »
I'm trying to use a Generic Controller in my Web API. My goal, which I am currently failing at, is to pass in an object from my front end that will ha...
(2) odpowiedzi
2017-09-25 23:09 Unable to cast resolved object to generic abstraction autofac C# »
Hey I try to cast my object to interface which this object should implements. But during executing code I have following error: Unable to cast obj...
(1) odpowiedzi
2017-09-21 16:09 Autowiring properties in base classes not working in ASP.NET Core 2 »
I have a .Net Core 2 app and an API controller class which inherits from an abstract base class: [Route("api/[controller]")] public class MyControl...
(0) odpowiedzi
2017-09-07 14:09 IdentityServer3, Autofac, IdentityFramework in existing project »
I have been playing around with IdentityServer3 with the hopes to replace our current authentication process. Currently we use a custom identity frame...
(1) odpowiedzi
2017-08-14 15:08 Thread synchronization in DI container managed instances »
I have a FooContext class that captures some HTTP request-specific runtime values from the request inside an ASP.NET Web API application public class...
(2) odpowiedzi
2017-08-11 13:08 Autofac and scope issues »
Ok, this is starting to get on my nerves. I wish I had never started using Autofac, it has just become too difficult to use. I have created a Module ...
(0) odpowiedzi
2017-08-06 14:08 Autofac parameterized instantiation that resolves differently for different parameters »
I'm using Autofac with ASP.NET Core. My dependency is a Reporter: public class Reporter { public Reporter (bool doLogging) { DoLogging = doLogging...
(1) odpowiedzi
2017-07-31 04:07 WebApi: Per Request Per Action DbSession using IoC, how? »
Our existing database deployment has a single 'master' and a read-only replica. Using ASP.NET's Web API2 and an IoC container I want to create control...
(1) odpowiedzi
2017-07-22 22:07 Web API Concurrancy Issue : Static web methods migrated to Per Request web api controllers »
Application : Asp.net with static web methods declared on page migrated to asp.net web forms with static web methods converted to web API 2 controlle...
(0) odpowiedzi
2017-04-20 15:04 XUnit Test Constructor dependence injection with Autofac »
I am implementing Xunit with Autofac, I could make it work by below code: using (var scoped = DbFixture.Container.Resolve<UserReponsit...
(2) odpowiedzi
2017-04-01 16:04 Autofac injection of an object's property rather than the object »
I'm using Autofac and EF Core, in an ASP.NET Core environment. My EF context: public interface IMyContext { /* ... */ } public class MyContext : Db...
(1) odpowiedzi
2017-03-22 11:03 dotnet core autofac and json configuration can they all work together in a console app »
I have been trying to get some dependency injection into my .net core console app as well as use an appsettings.json file. However I can't find an ...
(1) odpowiedzi
2017-03-22 06:03 Registering Generic Interfaces and classes with Autofac »
My current Autofac config is working to resolve my ApiControllers in a WebApi. Where I'm struggling is, I'm attempting to create a 'BaseApiController...
(2) odpowiedzi
2017-03-03 07:03 .NET Core IOC RegisterAssemblyTypes Equivalant »
I am using the standard built in .NET core IOC. But I need some functionality like that which comes with AutoFac. I want/need to limit the amount of t...
(2) odpowiedzi
2017-02-04 18:02 Hangfire in WebApi with Autofac: Job not running »
I use Hangfire with the Hangfire.MemoryStorage in my WebApi Application. I configured Hangfire in my owin startup.cs: Hangfire.GlobalConfiguration....
(1) odpowiedzi
2017-01-28 23:01 Set the type of registered Service during runtime within an action filter/message handler »
public class ActionFilterVersionAttribute : ActionFilterAttribute { public override void OnActionExecuting(HttpActionContext...
(1) odpowiedzi
2017-01-03 10:01 Exception trying to use attribute routing with autofac »
I have a problem with dependency injection when I'm trying to add custom route attribute on my action. Everything is working fine when I'm trying to u...
(1) odpowiedzi
2016-12-07 16:12 ExecuteReaderAsync and Autofac »
I have created an OracleUnitOfWork and Repository class like this: public class OracleUnitOfWork : IOracleUnitOfWork { // Private properties ...
(2) odpowiedzi
2016-11-28 17:11 Autofac or the way Delegates work is loading the wrong dependency inside ASP.Net Web API Bot Framework »
Since the Microsoft Bot Framework is using Autofac as a dependency, I figured I'd use it in the rest of my project (using the Bot Framework project sc...
(1) odpowiedzi
2016-11-25 16:11 Autofac Getting the current identity »
I have a Service and virtually every method requires the current user to execute. Before I started using autofac I basically created a public property...
(1) odpowiedzi
2016-09-26 10:09 Resolving per-user/per-request dependency with Autofac in StartUp »
I'm trying to resolve a dependency in the StartUp class of an ASP.Net WebApi 2 project. Autofac is used to configure the dependency injection. The sce...
(2) odpowiedzi
2016-09-07 09:09 Orchard CMS - How to specify the call order of content handlers? »
Content handlers resolved by Autofac are returned in an unpredicatable order. I need some content handlers to be invoked in a specific order. Example...
(1) odpowiedzi
2016-08-14 09:08 Autofac.Multitenant in an aspnet core application does not seem to resolve tenant scoped dependencies correctly »
I'm in the process of upgrading a Multitenant dotnet core solution which utilises the Autofac.Multitenant framework. I'm not having a lot of luck gett...
(1) odpowiedzi
2016-06-18 01:06 No way to get scope for current http request (Autofac 4)? »
How can we get ILifetimeScope for current http request when HttpContext exists? E.g. I want to resolve service from static extension method. I don't w...
(1) odpowiedzi
2016-06-15 07:06 Authorization with ASP.NET Identity & Autofac OWIN integration »
(an update has been added at the bottom of this question) I have a web application that uses both MVC5 and WebAPI2 with Autofac for DI. The app uses ...
(1) odpowiedzi
2016-04-12 10:04 WebApi REST service on IIS using Autofac, error on first call made »
I'm having an issue with a WebAPI project hosted on IIS that serves a REST API. The project uses Autofac to take care of creating the controllers. Thi...
(2) odpowiedzi
2016-04-09 17:04 Unit of work with EF 6 and Dependency injection Design problems »
I develop web application with entity framework 6, and have difficulties with designing the application structure. My main issue is how to deal with t...
(3) odpowiedzi
2016-04-08 14:04 Autofac with WebApi & Business Layer »
I am very new to AutoFac and am trying to use it for my new project with WebApi and Business Layer with contracts and their respective implementations...
(1) odpowiedzi
2016-03-07 23:03 How can you use Lazy<> with AutoMock (Moq) »
We are using Autofac.Extras.Moq.AutoMock. Now I have a constructor dependency using Lazy<> public MyService(Lazy<IDependency> myLazyDependen...
(1) odpowiedzi