Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public EditModel(BaseProject.Data.IssueTrackerContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
 public DetailsModel(BaseProject.Data.IssueTrackerContext context)
 {
     _context = context;
 }