{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4360","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4360/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4360/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4360/events","html_url":"https://github.com/aspnet/EntityFramework/issues/4360","id":127861056,"number":4360,"title":"Bug in EF7 with DI and two different DBContext","user":{"login":"SharpNoiZy","id":124893,"avatar_url":"https://avatars.githubusercontent.com/u/124893?v=3","gravatar_id":"","url":"https://api.github.com/users/SharpNoiZy","html_url":"https://github.com/SharpNoiZy","followers_url":"https://api.github.com/users/SharpNoiZy/followers","following_url":"https://api.github.com/users/SharpNoiZy/following{/other_user}","gists_url":"https://api.github.com/users/SharpNoiZy/gists{/gist_id}","starred_url":"https://api.github.com/users/SharpNoiZy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SharpNoiZy/subscriptions","organizations_url":"https://api.github.com/users/SharpNoiZy/orgs","repos_url":"https://api.github.com/users/SharpNoiZy/repos","events_url":"https://api.github.com/users/SharpNoiZy/events{/privacy}","received_events_url":"https://api.github.com/users/SharpNoiZy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-21T07:11:01Z","updated_at":"2016-01-21T07:11:01Z","closed_at":null,"body":"Hi,\r\n\r\nI try to use EF 7 RC1 with two different DBContext and resolve this two with DI.\r\n\r\n```\r\nservices.AddEntityFramework().AddSqlite().AddDbContext<ReadModelContext>(options => options.UseInMemoryDatabase());\r\nservices.AddEntityFramework().AddSqlite().AddDbContext<EventStoreContext>(options => { options.UseInMemoryDatabase(); });\r\n\r\nservices.AddSingleton<IReadModelContext>(provider => provider.GetService<ReadModelContext>());\r\nservices.AddSingleton<IEventStore>(provider => provider.GetService<EventStoreContext>());\r\n```\r\n\r\nBut in my ReadModelContext constructor an instance of:\r\nMicrosoft.Data.Entity.Infrastructure.DbContextOptions<EventStoreContext>\r\n\r\narrives.\r\nSo my quick and dirty thoughts are, that the second services.AddEntityFramework()... overrides the first one.\r\nFor me that is clearly a bug, because I can and I do specify the type I want to configure with AddDbContext<TContextType>.\r\n\r\n\r\nKind regards"}}