public bool ResetExternalRequestQueueItem(ExternalRequestQueue item)
        {
            if (!item.ExternalRequestQueueStatusEnum.Equals(ExternalRequestQueueStatusEnum.Failed))
            {
                return(false);
            }
            var update = new ExternalRequestQueueUpdateColumns
            {
                ExternalRequestQueueStatusEnum = ExternalRequestQueueStatusEnum.Pending,
                Revision = item.Revision + 1
            };
            var criteria = new ExternalRequestQueueSelectCriteria();

            criteria.Key.EqualTo(item.Key);
            criteria.Revision.EqualTo(item.Revision);
            return(_adaptor.Update(criteria, update));
        }
Exemple #2
0
        static public ExternalRequestQueue Insert(IUpdateContext update, ExternalRequestQueue entity)
        {
            var broker        = update.GetBroker <IExternalRequestQueueEntityBroker>();
            var updateColumns = new ExternalRequestQueueUpdateColumns();

            updateColumns.RequestType    = entity.RequestType;
            updateColumns.RequestXml     = entity.RequestXml;
            updateColumns.InsertTime     = entity.InsertTime;
            updateColumns.Revision       = entity.Revision;
            updateColumns.DeletionTime   = entity.DeletionTime;
            updateColumns.StateXml       = entity.StateXml;
            updateColumns.OperationToken = entity.OperationToken;
            updateColumns.RequestId      = entity.RequestId;
            updateColumns.ExternalRequestQueueStatusEnum = entity.ExternalRequestQueueStatusEnum;
            ExternalRequestQueue newEntity = broker.Insert(updateColumns);

            return(newEntity);
        }