Beispiel #1
0
        private static void CreateTasks(UserManager <AspNetUser> userManager)
        {
            IdentityRepository indentityRepo = new IdentityRepository(context, userManager);
            var userId = indentityRepo.GetAspNetUsers.FirstOrDefault().Id;

            TaskListRepository taskRepo = new TaskListRepository(context);

            for (var i = 0; i < 100; i++)
            {
                Task task = new Task();
                task.Description = "Task " + i;
                task.Location    = new Location {
                    LocationId = 2
                };
                task.Status = new Status {
                    StatusId = 1
                };
                task.User = new AspNetUser {
                    Id = userId
                };
                taskRepo.AddTask(task);
            }
        }