예제 #1
0
        private SyncLog Delete(SyncType type, int id, DeleteModel deleteDelegate)
        {
            var log = new SyncLog(SyncAction.Delete, type, id);

            try
            {
                deleteDelegate(id);
                log.SetSuccessful(null);
            }
            catch (Exception ex)
            {
                log.SetFailed(ex.Message);
            }
            return(log);
        }
예제 #2
0
        private SyncLog Upsert(SyncType type, object item, UpsertModel upsertDelegate)
        {
            var log = new SyncLog(SyncAction.Upsert, type, item);

            try
            {
                int?newEntityId = upsertDelegate(item);
                log.SetSuccessful(newEntityId);
            }
            catch (Exception ex)
            {
                log.SetFailed(ex.Message);
            }
            return(log);
        }