Questions tagged as 'simple-injector'

1
answer

Simple Injector + UoW + DDD + Multiple Contexts + Entity Framework

I need to know how to apply IoC for two contexts. The scenario is as follows: I have a Layer called Core (allocates classes that I can reuse in other layers), where I put the interface of IDbContext, IUnitOfWork and UnitOfWork (among ot...
asked by 03.12.2016 / 20:58
2
answers

How to use SimpleInjector in a multi-layer project?

Imagine the classic architecture: ConsoleApplication (Frontend) - > Business Layer (BLL) - > Data Access Layer (DAL) That is, Frontend reference BLL that reference DAL. Note that Frontend does not know the DAL, nor should it. Give...
asked by 28.12.2017 / 22:46
1
answer

- [Lifestyle Mismatch] ApplicationSignInManager (Web Request) depends on IAuthenticationManager (Transient)

I'm getting an error initializing simpleinjector that I can not solve at all. The error appears when it tries to execute the line: container.Verify(); Following error:    - [Lifestyle Mismatch] ApplicationSignInManager (Web Reques...
asked by 18.01.2017 / 01:40
1
answer

IoC with Web Service

I need to create a WS with IoC. I created a new Web project with Web API dependencies; I've added a Web Service (asmx); I installed SimpleInjector; The code looks like this: [WebService(Namespace = "http://tempuri.org/")] [W...
asked by 20.01.2017 / 11:48
0
answers

How to configure OwinContext Authentication in SimpleInjector 3.3.2?

In my current application I use SimpleInjector 3.2.0 with a configuration similar to this: var container = new Container(); container.Options.DefaultScopedLifestyle = new WebRequestLifestyle(); container.Register<IUserStore<Usuario>&...
asked by 26.01.2017 / 22:44
1
answer

SimpleInjector: The configuration is invalid. The type is directly or indirectly depending on itself

I have the following problem when applying the SimpleInjector container in a simple application: The configuration is invalid. The type BookAppService is directly or indirectly depending on itself. The cyclic graph contains the following typ...
asked by 31.03.2018 / 00:25
1
answer

Doubt about Mapping an Interface with a Class - SimpleInjector

I'm having trouble mapping Interface IClienteRepository to class ClienteRepository . When compiling the application, this error appears:    "exception {" To be able to use the Lifestyle.Scoped property, please ensure that the con...
asked by 06.12.2017 / 10:02
1
answer

Problems with a Dependency Injection Container - Simple Injector

I am mounting my ID container using the Simple Injector, but it is giving a compilation error (Underline red) in the config. of the IReadOnlyRepository Interface with the ClientDapperRepository class. I think I'm doing something wrong but I do n...
asked by 06.12.2017 / 00:29
0
answers

Problem with DepencyResolver when using TestServer, difference between instantiating HttpConfiguration and not instantiating

I have a simple authorization filter that to get an instance of a service I requirement in GlobalConfiguration.Configuration.DependencyResolver . So: var service = GlobalConfiguration.Configuration .DependencyResolver.GetService(type...
asked by 29.10.2017 / 22:43
0
answers

Asp.net C # DDD - Implementing Api Web

I am developing a System, with DDD structure with Simple Injector. When developing the WEB API, the data returned from the DB is null. In other tests performed in the MVC view, the same data is returned normally. The problem is in the impl...
asked by 03.09.2017 / 22:56