public void Build(SimpleTaskSystemDbContext context)
        {
            //Add some people

            context.People.AddOrUpdate(
                p => p.Name,
                new Person {
                Name = "Isaac Asimov"
            },
                new Person {
                Name = "Thomas More"
            },
                new Person {
                Name = "George Orwell"
            },
                new Person {
                Name = "Douglas Adams"
            }
                );

            context.SaveChanges();

            //Add some tasks

            context.Tasks.AddOrUpdate(
                t => t.Description,
                new Task
            {
                Description = "my initial task 1"
            },
                new Task
            {
                Description = "my initial task 2",
                State       = TaskState.Completed
            },
                new Task
            {
                Description    = "my initial task 3",
                AssignedPerson = context.People.Single(p => p.Name == "Douglas Adams")
            },
                new Task
            {
                Description    = "my initial task 4",
                AssignedPerson = context.People.Single(p => p.Name == "Isaac Asimov"),
                State          = TaskState.Completed
            });

            context.SaveChanges();
        }
Exemplo n.º 2
0
 public HostRoleAndUserCreator(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }
Exemplo n.º 3
0
 public TenantRoleAndUserBuilder(SimpleTaskSystemDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemplo n.º 4
0
 public DefaultTenantCreator(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public DefaultLanguagesCreator(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }
 public InitialHostDbBuilder(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }
Exemplo n.º 7
0
 public TestDataBuilder(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }
 public DefaultEditionsCreator(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }
 public DefaultSettingsCreator(SimpleTaskSystemDbContext context)
 {
     _context = context;
 }