public virtual SyncProductsResponse SyncProducts(SyncProductsRequest request) { var response = new SyncProductsResponse(); try { // Raise Initialization Event var initialization = SyncProductsInitialization; if (initialization != null) { initialization(request, response); } // Raise Execute Event var execute = SyncProductsExecute; if (execute != null) { response = execute(request); } // Raise Complete Event var complete = SyncProductsComplete; if (complete != null) { complete(request, response); } } catch (Exception exception) { // Raise Error Event var error = SyncProductsError; if (error != null) { error(request, response, exception); } } return(response); }
public override SyncProductsResponse OnSyncProductsExecute(SyncProductsRequest request) { var syncItemsFactory = new SyncItemsFactory(); var response = new SyncProductsResponse(); try { response.SyncProducts = syncItemsFactory.SyncProducts(request.BatchRecords, request.Skip); } catch (Exception ex) { response.Exception = ex; response.Message = ex.Message; } return(response); }