Ejemplo n.º 1
0
 public override void Read()
 {
     using (var context = new DataClasses1DataContext())
     {
         List<TestEntity> list = context.TestObjects.Where(to =>
             to.ID < ROWS).Select(to => CreateTestEntity(to)).ToList();
     }
 }
Ejemplo n.º 2
0
 public override void Create()
 {
     using (var context = new DataClasses1DataContext())
     {
         for (int id = 0; id < ROWS; id++)
         {
             TestEntity entity = CreateTestEntity(id);
             context.TestObjects.InsertOnSubmit(CreateTestObject(entity));
         }
         context.SubmitChanges();
     }
 }
Ejemplo n.º 3
0
 public override void Update()
 {
     using (var context = new DataClasses1DataContext())
     {
         for (int id = 0; id < ROWS; id++)
         {
             TestEntity entity = CreateTestEntity(id);
             TestObject obj = context.TestObjects.Single(to => to.ID == entity.ID);
             obj.Name = entity.Name + ".";
         }
         context.SubmitChanges();
     }
 }