title: Error 404 on page after adding new code in controller
body: <p>I added a new controller for a new model with its view and everything worked fine as default but when I added some code, it broke the page and now when I try to open it, I get the error 404. 
  If I remove that code, I still get the error and I can't go back to default. </p>
  
  <p>I tried the same thing on an other controller getting the same effect. </p>
  
  <p>I tried creating the controller with Entity framework and without with the same results. </p>
  
  <p>My other controller works fine for displaying data but creating data in database with this controller does not work.</p>
  
  <p><strong>The controller that doesn't work:</strong></p>
  
  <pre><code>public class AccessController : Controller
  {
      private readonly DataAccess data;
  
  
      public AccessController(DataAccess data)
      {
          this.data = data;
      }
  
      [HttpPost]
      [ValidateAntiForgeryToken]
      public ActionResult Create(AccessModel model)
      {
          if (ModelState.IsValid)
          {
              var CurrentUserName = this.User.FindFirstValue(ClaimTypes.Name);
              List&lt;ApplicationUser&gt; users = new List&lt;ApplicationUser&gt;();
              var userData = data.LoadUser();
              string userID = null;
  
              foreach (var row in userData)
              {
                  users.Add(new ApplicationUser
                  {
                      MachineId = row.MachineId,
                      Email = row.Email
                  });
              }
  
              for (int j = 0; j &lt; users.Count; j++)
              {
                  if (users[j].Email == CurrentUserName)
                      userID = users[j].MachineId;
              }
  
              AccessProcessor.CreateAccess(userID, model.OpenValve, model.OpenTrap,
                  model.OpenFeedingPen, model.StartMachine, data);
          }
          return View();
      }
  
  }
  </code></pre>
  
  <p><strong>Configure in startup:</strong></p>
  
  <pre><code> public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseDatabaseErrorPage();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
              app.UseHsts();
          }
  
          app.UseHttpsRedirection();
          app.UseStaticFiles();
          app.UseCookiePolicy();
  
          app.UseAuthentication();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
          });
      }
  </code></pre>
  
  <p><strong>appsettings.json:</strong></p>
  
  <pre><code>"ConnectionStrings": {
  "MVCCoreAppDB": "The connection string"
    },
    "Logging": {
      "LogLevel": {
        "Default": "Warning"
      }
    },
  "AllowedHosts": "*"
  </code></pre>