Пример #1
0
        static void CreateAdmin(UserStore userStore)
        {
            User admin = new User
            {
                UserName  = "******",
                FirstName = "Admin",
                Password  = "******",
                UserLevel = UserLevel.Admin
            };

            userStore.AddItem(admin);
            userStore.Save();
        }
Пример #2
0
 public async Task <ActionResult <User> > CreateUser(string name)
 {
     try
     {
         return(Ok(await _bugTrackerStore.AddItem(new User {
             Name = name
         })));
     }
     catch (Exception ex)
     {
         return(NotFound());
     }
 }