Ejemplo n.º 1
0
 private static void TestDelete( ISession session )
 {
     Student[] result;
     Console.WriteLine ( "Delete an object..." );
     result = session.Search<Student> ( "StudentId=='200730740404'" );
     session.Delete ( result[0] );
     session.Submit ();
     Console.WriteLine ( "Deleted Successfully..." );
     Console.ReadKey ();
     ReadObjects ( session );
 }
Ejemplo n.º 2
0
 private static void TestInsert( ISession session )
 {
     Student student = new Student ();
     Console.WriteLine ( "Insert an object to database..." );
     student.StudentId = "200730740404";
     student.Name = "Dickson";
     student.Gender = "Male";
     session.Insert ( student );
     session.Submit ();
     Console.WriteLine ( "Inserted Successfully..." );
     Console.ReadKey ();
     ReadObjects ( session );
 }
Ejemplo n.º 3
0
 private static void TestUpdate( ISession session )
 {
     Student[] result;
     Console.WriteLine ( "Update an object..." );
     result = session.Search<Student> ( "StudentId=='200730740402'" );
     result[0].Name = "Lisa";
     result[0].Gender = "Female";
     session.Update ( result[0] );
     session.Submit ();
     Console.WriteLine ( "Updated Successfully..." );
     Console.ReadKey ();
     ReadObjects ( session );
 }