Ejemplo n.º 1
0
        private static void addCheckpointsService()
        {
            using (var srv = new CheckpointService())
            {
                var cp2 = new Checkpoint()
                {
                    Id = 2,
                    Title = "Checkpoint 2",
                    Description = "Sample checkpoint 2",
                    ExpectedResult = "Result checkpoint 2",
                    AuthorName = "Ukrit",
                    Rating = 2
                };

                var cp1 = new Checkpoint()
                {
                    Id = 1,
                    Title = "Checkpoint 1",
                    Description = "Sample checkpoint 1",
                    ExpectedResult = "Result checkpoint 2",
                    AuthorName = "Ukrit",
                    Rating = 1,
                    NextCheckpoint = cp2
                };
                try{
                    srv.AddCheckpoint(cp1);
                    srv.AddCheckpoint(cp2);
                    var n = srv.SaveChangesService();
                    Console.WriteLine("Insert {0} checkpoints.", n);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Ejemplo n.º 2
0
 public Checkpoint RemoveCheckpoint(Checkpoint item)
 {
     return repo.Remove(item);
 }
Ejemplo n.º 3
0
 public Checkpoint Remove(Checkpoint item)
 {
     return db.Checkpoints.Remove(item);
     //throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public Checkpoint AddCheckpoint(Checkpoint item)
 {
     return repo.Add(item);
 }
Ejemplo n.º 5
0
 public Checkpoint Add(Checkpoint item)
 {
     return db.Checkpoints.Add(item);
     //throw new NotImplementedException();
 }