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);
	    }
 public ExternalRequestQueueSelectCriteria(ExternalRequestQueueSelectCriteria other)
 : base(other)
 {}
 public ExternalRequestQueueSelectCriteria(ExternalRequestQueueSelectCriteria other)
     : base(other)
 {
 }
 public int Count(ExternalRequestQueueSelectCriteria criteria)
 {
     return _adaptor.GetCount(criteria);
 }
 public IList<ExternalRequestQueue> FindExternalRequestQueue(ExternalRequestQueueSelectCriteria criteria, int startIndex, int maxRows)
 {
     return _adaptor.GetRange(criteria, startIndex, maxRows);
 }
        private IList<ExternalRequestQueue> InternalSelect(int startRowIndex, int maximumRows, out int resultCount)
        {
            resultCount = 0;

            if (maximumRows == 0) return new List<ExternalRequestQueue>();

            if (SearchKeys != null)
            {
                IList<ExternalRequestQueue> archiveQueueList = new List<ExternalRequestQueue>();
                foreach (ServerEntityKey key in SearchKeys)
                    archiveQueueList.Add(ExternalRequestQueue.Load(key));

                resultCount = archiveQueueList.Count;

                return archiveQueueList;
            }

            var criteria = new ExternalRequestQueueSelectCriteria();
            if (!string.IsNullOrEmpty(RequestType))
                criteria.RequestType.EqualTo(RequestType);

            if (StatusEnum != null)
                criteria.ExternalRequestQueueStatusEnum.EqualTo(StatusEnum);

            criteria.InsertTime.SortDesc(0);

            IList<ExternalRequestQueue> list = _searchController.FindExternalRequestQueue(criteria, startRowIndex,
                                                                                          maximumRows);

            resultCount = _searchController.Count(criteria);

            return list;
        }