Hi Danilo,
I am having the same issue, I have a prototype with Northwind and Adventure works together.
Here is my UnityConfig.
Thanks!!!
I am having the same issue, I have a prototype with Northwind and Adventure works together.
Here is my UnityConfig.
container.RegisterType<IRepositoryProvider, RepositoryProvider>(
new PerRequestLifetimeManager(),
new InjectionConstructor(new object[] { new RepositoryFactories() })
);
container.RegisterType<IUnitOfWorkAsync, UnitOfWork>(new PerRequestLifetimeManager());
// Northwind
container.RegisterInstance(new NorthwindContext());
container.RegisterType<IDataContextAsync, NorthwindContext>(new PerRequestLifetimeManager());
container.RegisterType<IRepositoryAsync<Customer>, Repository<Customer>>();
container.RegisterType<IRepositoryAsync<Product>, Repository<Product>>();
container.RegisterType<IRepositoryAsync<Order>, Repository<Order>>();
container.RegisterType<ICustomerService, CustomerService>();
container.RegisterType<IProductService, ProductService>();
container.RegisterType<IOrderService, OrderService>();
// Adventure Works
container.RegisterInstance(new AdventureWorksContext());
container.RegisterType<IDataContextAsync, AdventureWorksContext>(new PerRequestLifetimeManager());
container.RegisterType<IRepositoryAsync<Address>, Repository<Address>>();
container.RegisterType<IRepositoryAsync<Person>, Repository<Person>>();
container.RegisterType<IPersonService, PersonService>();
container.RegisterType<IAddressService, AddressService>();
Can you please post your UnityConfig, so we can see how you resolve your issue.Thanks!!!