Ejemplo n.º 1
0
 private void DoInsertSprint()
 {
     Sprints.Insert(Sprints.IndexOf(this) + 1, new UISprint(EvAgg, Sprints, new NodeRoot(EvAgg, viewModel), viewModel, databaseSchemaViewModel)
     {
         Name = "NAME", Number = 99, Version = "9.9.9.9"
     });
 }
Ejemplo n.º 2
0
 private void DoInsertSprint()
 {
     Sprints.Insert(Sprints.IndexOf(this) + 1, new UISprint(EvAgg, Sprints, new NodeRoot(EvAgg))
     {
         Name = "NAME", Number = 99, Version = "9.9.9.9"
     });
 }
Ejemplo n.º 3
0
        //todo: mange this with attributres in in entity classes

        /*protected override void OnModelCreating(DbModelBuilder modelBuilder)
         * {
         *  modelBuilder.Entity<Sprint>()
         *      .HasKey(s => s.ID)
         *      .HasRequired(s => s.Project)
         *      .WithMany(p => p.Sprints)
         *      .HasForeignKey(s => s.ProjectId);
         *
         *  modelBuilder.Entity<Project>()
         *      .HasKey(p => p.ID)
         *      .HasOptional(p => p.Backlog);
         *
         *  modelBuilder.Entity<Feature>()
         *      .HasKey(s => s.ID)
         *      .HasRequired(s => s.Project)
         *      .WithMany(p => p.Features)
         *      .HasForeignKey(s => s.ProjectId);
         *
         *  modelBuilder.Entity<Project>()
         *      .HasKey(p => p.ID)
         *      .HasOptional(p => p.DefaultFeature);
         * }*/

        public async Task AddNewProject(Project project)
        {
            Projects.Insert(project);
            await SaveChangesAsync();

            var sprint = new Sprint("Backlog", project);

            Sprints.Insert(sprint);

            project.BacklogId           = sprint.ID;
            project.NextProjectTicketId = 1;
            await SaveChangesAsync();
        }