//TODO: enable partial update call backs with expando objects maybe in MereRepo instead of MereRepo<T> // public void PubUpdate(ExpandoObject updateObj) // { // foreach (var sub in _subscriptions.Values) // { // if (sub.UpdateCallback != null) // sub.UpdateCallback(updateObj); // } // } // public void Update(ExpandoObject updateObj) // { // var d = (IDictionary<string, object>)updateObj; // if (d.ContainsKey(_keyColumn.ColumnName)) // { // var val = d[_keyColumn.ColumnName]; // var str = val != null ? val.ToString() : "0"; // if (_keyColumn.IsIdentity) // { // var key = int.Parse(str); // if (key > 0) // { // updateObj.MereUpdateSync<T>(); // } // } // } // } public void Delete(T toDelete) { var deleted = MereDelete.Create <T>() .AddFilter(_keyColumn.ColumnName, SqlOperator.EqualTo, _keyColumn.GetBase(toDelete)) .Execute(); if (deleted > 0) { PubDelete(toDelete); } }
public static IMereDeletePre <T> Create <T>(MereDataSource dataSource) where T : new() { return(MereDelete <T> .Create(dataSource)); }
public static IMereDeletePre <T> Create <T>() where T : new() { return(MereDelete <T> .Create()); }