static public void Delete(System.String id) { var obj = new Group(); obj.Id = id; obj.AcceptChanges(); obj.MarkAsDeleted(); obj.Save(); }
static public void Delete(System.String id, esSqlAccessType sqlAccessType) { var obj = new Group(); obj.Id = id; obj.AcceptChanges(); obj.MarkAsDeleted(); obj.Save(sqlAccessType); }
public void TestSaveWithoutAutoKey() { CustomerGroup cg = new CustomerGroup(); cg.es.Connection.Name = "ForeignKeyTest"; Group g = new Group(); g.es.Connection.Name = "ForeignKeyTest"; try { using (esTransactionScope scope = new esTransactionScope()) { cg.GroupID = "XXXXy"; cg.GroupName = "Test Group"; g = cg.Group; g.Id = cg.GroupID; g.Notes = "Some Text"; cg.Save(); Assert.IsTrue(cg.Group.es.HasData); Assert.AreEqual(cg.GroupID, cg.Group.Id); } } finally { // Clean up cg = new CustomerGroup(); cg.es.Connection.Name = "ForeignKeyTest"; if (cg.LoadByPrimaryKey("XXXXy")) { g = cg.Group; g.MarkAsDeleted(); cg.MarkAsDeleted(); cg.Save(); } } }