{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1395","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1395/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1395/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1395/events","html_url":"https://github.com/aspnet/EntityFramework/issues/1395","id":54218311,"number":1395,"title":"Connection configuration always chooses configuration with full name","user":{"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},"labels":[{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/pri1","name":"pri1","color":"eb6420"},{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/test","name":"test","color":"c7def8"}],"state":"open","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","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":166,"closed_issues":95,"state":"open","created_at":"2014-05-21T19:25:32Z","updated_at":"2015-01-16T19:13:29Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-01-13T16:59:08Z","updated_at":"2015-01-16T19:13:59Z","closed_at":null,"body":"When using multiple configuration files, if one configuration file specifies a connection string using the full name of the DbContext and the other uses the short name, the configuration from the file with the full name is always selected regardless of the order of the configuration files.\r\n\r\n```cs\r\nnamespace FullName\r\n{\r\n    public class MyContext : DbContext\r\n    {\r\n        public MyContext(IServiceProvider serviceProvider)\r\n            : base(serviceProvider)\r\n        {\r\n        }\r\n    }\r\n\r\n    public class Program\r\n    {\r\n        public void Main(string[] args)\r\n        {\r\n            var configuration = new Configuration();\r\n            configuration.AddIniFile(\"config1.ini\");\r\n            configuration.AddIniFile(\"config2.ini\");\r\n\r\n            var serviceProvider = new ServiceCollection()\r\n                .AddEntityFramework(configuration)\r\n                .AddSqlServer()\r\n                .AddDbContext<MyContext>()\r\n                .ServiceCollection\r\n                .BuildServiceProvider();\r\n\r\n            using (var context = new MyContext(serviceProvider))\r\n            {\r\n                context.Database.EnsureCreated();\r\n                Console.WriteLine(context.Database.AsRelational().Connection.ConnectionString);\r\n                Console.ReadLine();\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nconfig1.ini:\r\n```ini\r\n[EntityFramework]\r\nFullName.MyContext:ConnectionString = Data Source=(localdb)\\v11.0;Initial Catalog=MyDBFull;Integrated Security=True;MultipleActiveResultSets=True;Connect Timeout=30\r\n```\r\n\r\nconfig2.ini\r\n```ini\r\n[EntityFramework]\r\nMyContext:ConnectionString = Data Source=(localdb)\\v11.0;Initial Catalog=MyDBShort;Integrated Security=True;MultipleActiveResultSets=True;Connect Timeout=30\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments/70305770","html_url":"https://github.com/aspnet/EntityFramework/issues/1395#issuecomment-70305770","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/1395","id":70305770,"user":{"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},"created_at":"2015-01-16T19:13:59Z","updated_at":"2015-01-16T19:13:59Z","body":"Assigning to @mikary to add a test to ensure we don't change this behavior in the future."}}