{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2090","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2090/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2090/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/2090/events","html_url":"https://github.com/aspnet/EntityFramework/issues/2090","id":72011004,"number":2090,"title":"Calling AddSqlServer more than once shouldn't result in an error.","user":{"login":"matthewDDennis","id":8105715,"avatar_url":"https://avatars.githubusercontent.com/u/8105715?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewDDennis","html_url":"https://github.com/matthewDDennis","followers_url":"https://api.github.com/users/matthewDDennis/followers","following_url":"https://api.github.com/users/matthewDDennis/following{/other_user}","gists_url":"https://api.github.com/users/matthewDDennis/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewDDennis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewDDennis/subscriptions","organizations_url":"https://api.github.com/users/matthewDDennis/orgs","repos_url":"https://api.github.com/users/matthewDDennis/repos","events_url":"https://api.github.com/users/matthewDDennis/events{/privacy}","received_events_url":"https://api.github.com/users/matthewDDennis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/2%20-%20Done","name":"2 - Done","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/pri0","name":"pri0","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"mikary","id":6787717,"avatar_url":"https://avatars.githubusercontent.com/u/6787717?v=3","gravatar_id":"","url":"https://api.github.com/users/mikary","html_url":"https://github.com/mikary","followers_url":"https://api.github.com/users/mikary/followers","following_url":"https://api.github.com/users/mikary/following{/other_user}","gists_url":"https://api.github.com/users/mikary/gists{/gist_id}","starred_url":"https://api.github.com/users/mikary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikary/subscriptions","organizations_url":"https://api.github.com/users/mikary/orgs","repos_url":"https://api.github.com/users/mikary/repos","events_url":"https://api.github.com/users/mikary/events{/privacy}","received_events_url":"https://api.github.com/users/mikary/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/7","html_url":"https://github.com/aspnet/EntityFramework/milestones/7.0.0","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/7/labels","id":666128,"number":7,"title":"7.0.0","description":"","creator":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"open_issues":202,"closed_issues":7,"state":"open","created_at":"2014-05-21T19:25:32Z","updated_at":"2015-07-21T16:00:13Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-04-29T22:52:58Z","updated_at":"2015-07-21T16:00:13Z","closed_at":"2015-07-21T16:00:13Z","body":"I am getting the following error when I first use the ContentTaxonomyDbContext.\r\n\r\n> An exception of type 'System.InvalidOperationException' occurred in EntityFramework.Core.dll but was not handled in user code\r\n>\r\n> Additional information: The data stores 'SqlServerDataStore' 'SqlServerDataStore' are configured. A context can only be configured to use a single data store.\r\n\r\n\r\nI have the following method \r\n```c#\r\n        public static IServiceCollection AddSqlTaxonomyLookups(this IServiceCollection services, string connectionString)\r\n        {\r\n            var entityFrameworkServicesBuilder = new EntityFrameworkServicesBuilder(services);\r\n            entityFrameworkServicesBuilder\r\n                                          .AddSqlServer() // no error if this is commented out\r\n                                          .AddDbContext<ContentTaxonomyDbContext>(options =>\r\n                options.UseSqlServer(connectionString));\r\n\r\n            AddLookupServices(services);\r\n\r\n            return services;\r\n        }\r\n```\r\nthat I call at the end of the Startup.ConfigureServices\r\n\r\n```c#\r\n        // This method gets called by the runtime. Use this method to add services to the container.\r\n        public void ConfigureServices(IServiceCollection services)\r\n        {\r\n            // Add Application settings to the services container.\r\n            services.Configure<AppSettings>(Configuration.GetSubKey(\"AppSettings\"));\r\n\r\n            // Add EF services to the services container.\r\n            services.AddEntityFramework()\r\n                .AddSqlServer()\r\n                .AddDbContext<CodeProjectIdentityDbContext>(options =>\r\n                    options.UseSqlServer(Configuration[\"Data:Identity:ConnectionString\"]));\r\n             ...\r\n            // Add our services\r\n            services.AddSqlTaxonomyLookups(Configuration[\"Data:Content:ConnectionString\"]);\r\n        }\r\n```\r\n\r\n<!---\r\n@huboard:{\"order\":2620.0,\"milestone_order\":2090,\"custom_state\":\"\"}\n-->\r\n"}}