title: How do I seed Users and Roles in MVC6
body: <p>I've started in Visual Studio with a new project > ASP NET 5 > Web Application and then followed the initial tutorial here:</p>
  
  <p><a href="https://docs.asp.net/projects/mvc/en/latest/getting-started/first-mvc-app/index.html" rel="nofollow noreferrer">https://docs.asp.net/projects/mvc/en/latest/getting-started/first-mvc-app/index.html</a></p>
  
  <p>One of the tasks I've been struggling with is seeding the database with Users, Roles, and then assigning the Roles to the Users.</p>
  
  <p>This answer, or variations of it look fruitful: 
  <a href="https://stackoverflow.com/a/20521530/2591770">https://stackoverflow.com/a/20521530/2591770</a></p>
  
  <p>But this code:</p>
  
  <pre><code>    var store = new UserStore&lt;ApplicationUser&gt;(context);
      var manager = new UserManager&lt;ApplicationUser&gt;(store);
      var user = new ApplicationUser {UserName = "founder"};
  </code></pre>
  
  <p>Results in an immediate error.</p>
  
  <p>CS7036  There is no argument given that corresponds to the required formal parameter 'optionsAccessor' of 'UserManager.UserManager(IUserStore, IOptions, IPasswordHasher, IEnumerable>, IEnumerable>, ILookupNormalizer, IdentityErrorDescriber, IServiceProvider, ILogger>, IHttpContextAccessor)'</p>
  
  <p>Is this a change in the framework or is it likely I've omitted something elsewhere?</p>
  
  <p>I can null the rest of the parameters but can't help feeling that I've missed something.</p>
  
  <pre><code>var userManager = new UserManager&lt;ApplicationUser&gt;(userStore,null,null,null,null,null,null,null,null,null);
  </code></pre>