{"action":"opened","issue":{"url":"https://api.github.com/repos/ivaylokenov/MyTested.AspNetCore.Mvc/issues/276","repository_url":"https://api.github.com/repos/ivaylokenov/MyTested.AspNetCore.Mvc","labels_url":"https://api.github.com/repos/ivaylokenov/MyTested.AspNetCore.Mvc/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/ivaylokenov/MyTested.AspNetCore.Mvc/issues/276/comments","events_url":"https://api.github.com/repos/ivaylokenov/MyTested.AspNetCore.Mvc/issues/276/events","html_url":"https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/issues/276","id":244824981,"number":276,"title":"problem on resolving DbContext in a Domain-Driven Design Solution","user":{"login":"HesamKashefi","id":16811776,"avatar_url":"https://avatars3.githubusercontent.com/u/16811776?v=4","gravatar_id":"","url":"https://api.github.com/users/HesamKashefi","html_url":"https://github.com/HesamKashefi","followers_url":"https://api.github.com/users/HesamKashefi/followers","following_url":"https://api.github.com/users/HesamKashefi/following{/other_user}","gists_url":"https://api.github.com/users/HesamKashefi/gists{/gist_id}","starred_url":"https://api.github.com/users/HesamKashefi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HesamKashefi/subscriptions","organizations_url":"https://api.github.com/users/HesamKashefi/orgs","repos_url":"https://api.github.com/users/HesamKashefi/repos","events_url":"https://api.github.com/users/HesamKashefi/events{/privacy}","received_events_url":"https://api.github.com/users/HesamKashefi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-22T05:09:38Z","updated_at":"2017-07-22T05:09:38Z","closed_at":null,"body":"Hi, \r\nI've used Domain-Driven Design approach for My project so it has a main DbContext that has all the DbSets and some other DbContext for each BoundedContext of the project which have only a subset of DbSets and and obviously Models have only a subset of properties of the Main ones...(all contexts use the same database).\r\nI've registered the main dbContext in Startup.cs with AddDbContext .... Method and the others are registered with AddScoped<....> .\r\nThe project works fine but when I use MyTested.AspNetCore.Mvc for testing it fails to resolve repositories that don't use the Main dbContext ...\r\nwith error  : \r\n_\r\n\r\n> Message: Test method MyAPI.Controllers.Tests.CardBoxesControllerTests.GetCardBoxes threw exception: \r\n> MyTested.AspNetCore.Mvc.Exceptions.UnresolvedServicesException: CardBoxesController could not be instantiated because it contains no constructor taking no parameters.\r\n\r\n_\r\nSo what is the problem? how can I fix this? \r\nAnd I just guess that this is it's problem! Maybe I'm wrong but from my standing point I can't get to any other conclusion..."}}
{"actor":{"display_login":"HesamKashefi"}}