{"action":"created","issue":{"url":"https://api.github.com/repos/dd4t/DD4T.Core/issues/32","labels_url":"https://api.github.com/repos/dd4t/DD4T.Core/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/dd4t/DD4T.Core/issues/32/comments","events_url":"https://api.github.com/repos/dd4t/DD4T.Core/issues/32/events","html_url":"https://github.com/dd4t/DD4T.Core/issues/32","id":107679232,"number":32,"title":"ViewModelFactory must be limited in the assemblies which it searches","user":{"login":"quirijnslings","id":1014199,"avatar_url":"https://avatars.githubusercontent.com/u/1014199?v=3","gravatar_id":"","url":"https://api.github.com/users/quirijnslings","html_url":"https://github.com/quirijnslings","followers_url":"https://api.github.com/users/quirijnslings/followers","following_url":"https://api.github.com/users/quirijnslings/following{/other_user}","gists_url":"https://api.github.com/users/quirijnslings/gists{/gist_id}","starred_url":"https://api.github.com/users/quirijnslings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quirijnslings/subscriptions","organizations_url":"https://api.github.com/users/quirijnslings/orgs","repos_url":"https://api.github.com/users/quirijnslings/repos","events_url":"https://api.github.com/users/quirijnslings/events{/privacy}","received_events_url":"https://api.github.com/users/quirijnslings/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dd4t/DD4T.Core/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-22T09:48:32Z","updated_at":"2015-09-22T18:13:23Z","closed_at":null,"body":"Currently, all assemblies that are loaded in memory are searched looking for view models (i.e. classes implementing IViewModel). This is highly inefficient! For example, your app will go over all classes in assemblies like System, System.Web, DD4T.*, Tridion.*, etc..\r\n\r\nWe need to find a way to limit this to assemblies which are likely to contain the customer's view models. Possibilities are:\r\n\r\n- Add 'ViewModelAssemblies' key to the configuration and have the ViewModelFactory search that\r\n- Add a public property 'ViewModelAssemblies' to the ViewModelFactory interface so you can set it manually in the global.asax\r\n- Hard-code the factory to NOT search in anything starting with System, DD4T or Tridion (on the plus side this requires no configuration at all, but it still leaves countless others like Newtonsoft, Autofac, .... )\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dd4t/DD4T.Core/issues/comments/142369063","html_url":"https://github.com/dd4t/DD4T.Core/issues/32#issuecomment-142369063","issue_url":"https://api.github.com/repos/dd4t/DD4T.Core/issues/32","id":142369063,"user":{"login":"Ei8htSe7en","id":10552215,"avatar_url":"https://avatars.githubusercontent.com/u/10552215?v=3","gravatar_id":"","url":"https://api.github.com/users/Ei8htSe7en","html_url":"https://github.com/Ei8htSe7en","followers_url":"https://api.github.com/users/Ei8htSe7en/followers","following_url":"https://api.github.com/users/Ei8htSe7en/following{/other_user}","gists_url":"https://api.github.com/users/Ei8htSe7en/gists{/gist_id}","starred_url":"https://api.github.com/users/Ei8htSe7en/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ei8htSe7en/subscriptions","organizations_url":"https://api.github.com/users/Ei8htSe7en/orgs","repos_url":"https://api.github.com/users/Ei8htSe7en/repos","events_url":"https://api.github.com/users/Ei8htSe7en/events{/privacy}","received_events_url":"https://api.github.com/users/Ei8htSe7en/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T18:13:23Z","updated_at":"2015-09-22T18:13:23Z","body":"Ah ok I see now, the ctor is calling that method (doh!) &mdash; definitely shouldn't be doing that. I must have written that code for testing or something and forgot to remove it. I'll just remove that call in the ctor so it is up to the user to Load assemblies"}}