title: Routing with Areas and Controller Name (asp.net core)
body: <p>To stop my application from getting cluttered I started working with areas. But now I always have to call:<br>
  <a href="http://localhost:49358/Document/Document/" rel="nofollow noreferrer">http://localhost:49358/Document/Document/</a><br>
  instead of:<br>
  <a href="http://localhost:49358/Document/" rel="nofollow noreferrer">http://localhost:49358/Document/</a><br>
  How can I change my route to access the Controllers by name of the Area?
  (no HomeController)</p>
  
  <p>I have the following folder structure inside of my Project:</p>
  
  <p><a href="https://i.stack.imgur.com/6toxn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6toxn.png" alt="Folderstructure inside my Project"></a><br>
  The code for my route to the Areas looks like this:</p>
  
  <pre><code>routes.MapRoute(name: "areaRoute",template: "{area:exists}/{controller=Home}/{action=Index}");
  </code></pre>
  
  <p>And I placed the [Area("Document")] Tag in my DocumentController.</p>
  
  <p><strong>Edit:</strong><br>
  As suggested by Shyju and Jamie Taylor I went with the HomeControllers. (Thank you both for the quick answers and explanations)    </p>
  
  <p>My Structure now looks like this and the routing is working like expected:<br>
  <a href="https://i.stack.imgur.com/9hhVS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9hhVS.png" alt="enter image description here"></a>  </p>
  
  <p>For me it's still a bit dissapointing to have so many HomeControllers and Index Files. Navigating code isn't that easy anymore:<br>
  <a href="https://i.stack.imgur.com/XEOn6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XEOn6.png" alt="enter image description here"></a></p>
  
  <p><strong>Edit2:</strong><br>
  After getting too annoyed with all those Homecontrollers, I went with the solution suggested by Jamie Taylor and rearanged everything in a <strong>Features</strong> folder. It needs a bit more configuration but is much cleaner in my opinion.<br>
  It is also further explained in this Microsoft Article (Just skip the Area stuff):<br>
  <a href="https://msdn.microsoft.com/en-us/magazine/mt763233.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/magazine/mt763233.aspx</a>    </p>
  
  <p>My structure now looks like this and routing works like a charm and the controller names are still meaningful:<br>
  <a href="https://i.stack.imgur.com/TVBJ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TVBJ6.png" alt="enter image description here"></a></p>