public static T Insert <T>(this DirectDatabaseBase db, DirectModel model) where T : DirectModel { DirectExecuteResult result = db.Execute(model.ConstructInsertQuery()); if (result.IsSuccessfull && result.LastID.HasValue) { model.LongID = result.LastID; model.Snapshot.SetSnapshot(); return((T)model); } return((T)model); }
public static void InsertLater(this DirectModel model) { model.GetDatabase().TransactionalManager.Add(model.ConstructInsertQuery()); }