public static void Initialize(IssueTrackerContext context) { context.Database.EnsureCreated(); if (context.Users.Any()) { return; } var users = new [] { new User { FirstName = "System", LastName = "Administrator", Username = "******" } }; context.Users.AddRange(users); context.SaveChanges(); var issues = new[] { new Issue { Description = "First unassigned Issue", Status = Status.Defined }, new Issue { Description = "First assigned Issue", Status = Status.Accepted, AssigneeId = users.First().Id } }; context.Issues.AddRange(issues); context.SaveChanges(); var tasks = new[] { new IssueTask { Description = "First unassigned issue task 1", Status = Status.Defined, IssueId = issues.First().Id }, new IssueTask { Description = "First assigned issue task 1", Status = Status.Defined, IssueId = issues.First().Id, AssigneeId = users.First().Id } }; context.IssueTasks.AddRange(tasks); context.SaveChanges(); }
public EditModel(BaseProject.Data.IssueTrackerContext context) { _context = context; }
public DetailsModel(BaseProject.Data.IssueTrackerContext context) { _context = context; }