{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/Scaffolding/issues/199","repository_url":"https://api.github.com/repos/aspnet/Scaffolding","labels_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/199/comments","events_url":"https://api.github.com/repos/aspnet/Scaffolding/issues/199/events","html_url":"https://github.com/aspnet/Scaffolding/issues/199","id":150120415,"number":199,"title":"Scaffolding Error when working with EF Fluent API","user":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-21T16:13:56Z","updated_at":"2016-04-21T16:13:56Z","closed_at":null,"body":"Move from https://github.com/aspnet/Mvc/issues/4336, opened by @hernandemczuk\r\n\r\n=========\r\n\r\nI have a **Data Acces Logic (Entity Framework)** project, a **Model** project with my POCOs classes and a last one with the **MVC Application**. In my DAL project, I configure some validations on my Model and its schema information on the database using **Fluent API**. That means that I use the following method in order to add these configurations:\r\n\r\n`protected override void OnModelCreating(DbModelBuilder modelBuilder)\r\n        {\r\n            modelBuilder.Configurations.Add(new Model1Configuration());\r\n        }\r\n`\r\n\r\nWhen I try to add a new controller to my MVC application I select the option **MVC Controller with views, using Entity Framework**, which leads me to pick a **Data Context Class** and a **Model Class**. I mark **Generate Views** and write a **Controller Name** to finally click on **Add...**\r\n\r\nThen the following alert shows up:\r\n\r\n![error](https://cloud.githubusercontent.com/assets/4275069/14003095/05c05a5a-f12f-11e5-8da1-a7f94c7a1ec5.png)\r\n\r\nI know it has something to do with the Fluent API, because if I comment out the previuos method I mentioned I can scaffold without any problem.\r\n\r\nI'm using MVC v5.2.3 , Entity Framework v6.1.3\r\n"}}