private static bool MasterAction(BEntity op, ILocalBox box) { switch (op.ActionType) { case ActionType.Insert: return box.Insert(op.TableName, op.Value); case ActionType.Delete: return box.Delete(op.TableName, op.Key); case ActionType.Update: if (box.Update(op.TableName, op.Key, op.Value)) { return true; } else { return box.Insert(op.TableName, op.Value); } } throw new Exception(""); }
private static bool MasterAction(BEntity op, ILocalBox box) { switch (op.ActionType) { case ActionType.Insert: return(box.Insert(op.TableName, op.Value)); case ActionType.Delete: return(box.Delete(op.TableName, op.Key)); case ActionType.Update: if (box.Update(op.TableName, op.Key, op.Value)) { return(true); } else { return(box.Insert(op.TableName, op.Value)); } } throw new Exception(""); }