Question: I've been having some trouble with a homework assignment for my Java class. In it, we're supposed to take in an integer between 1 and 13 and display three different triangles consisting of numbers. For example, if I were to enter 5, the result would be:

Triangle 1

```
     1
     2  3
     4  5  6
     7  8  9 10
    11 12 13 14 15

```

Triangle 2

```
    1
    2 6
    3 7 10
    4 8 11 13
    5 9 12 14 15

```

Triangle 3

```
               5
            4  9
         3  8 12
      2  7 11 14
    1 6 10 13 15

```

I've already got the first Triangle going fine, but my big concern is the second triangle. I haven't attempted the third one yet. The other thing is that my Professor is picky about what method we use in creating the project. In other words, we can only use what he has taught us. He told us to use the System.out.printf("%3d", n) statement to space out the characters and we have to create them within a separate class.

The code for the first triangle is as follows:

```
    void triangle1(int n)
    {
        int k = 1;
        for (int i = 1; i <= n; i++)
        {
            for (int j = 0; j < 1; j++)
            {
                System.out.printf("%3d", n);
                k += 1;
            }

            System.out.println();
        }
    }

```

So, pretty much, I need to follow that standard to create the other two triangles, but I'm really stuck on the second one and I don't know where to start. Any help will be much appreciated!

Answer: 
try   

project.entitykey = oldproject.entitykey   
before savechanges
I found a solution

Instead

```
public ActionResult Edit(Project project)
    {
     Project beforeEditProject = db.Projectes.Find(project.ID);
     .... 
    }

```

}

Use

```
public ActionResult Edit(Project project)
        {
          Project beforeEditProject = db.Projectes.AsNoTracking().First(p => p.ID == project.ID);
          .....
        }

```