Windows Phone 7 Database Rapid Repository V2.0 Examining Operation Requests
Rapid Repository is a Windows Phone 7 Database and Silverlight Isolated Storage Database.
Download Rapid Repository from Microsoft Codeplex
Blog Tutorials
- Release Overview
- Creating and saving entities
- Create, read, update and delete operations
- Querying with views and filters
- Caching
- File Helper
- Examining Operation Requests
If you need to examine the pending operation requests or even remove pending requests before calling SaveChanges() you can access them through the following property:
- public void ExamineOperationRequests()
- {
- List<OperationRequest> requests = RapidContext.CurrentContext.OperationRequests;
- }
If you need to delete a request or all off the requests you can use the following methods:
- public void ExamineOperationRequests()
- {
- List<OperationRequest> requests = RapidContext.CurrentContext.OperationRequests;
- RapidContext.CurrentContext.DeleteOperationRequest(requests.First());
- RapidContext.CurrentContext.DeleteAllOperationRequests();
- }
The operation request class has the following properties you can use for examination:
- /// <summary>
- /// Gets or sets the entity id.
- /// </summary>
- /// <value>The entity id.</value>
- public Guid EntityId { get; private set; }
- /// <summary>
- /// Gets or sets the entity.
- /// </summary>
- /// <value>The entity.</value>
- public object Entity { get; private set; }
- /// <summary>
- /// Gets or sets the type of the entity.
- /// </summary>
- /// <value>The type of the entity.</value>
- public Type EntityType { get; private set; }
- /// <summary>
- /// Gets or sets the type of the operation.
- /// </summary>
- /// <value>The type of the operation.</value>
- public OperationRequestType OperationRequestType { get; private set; }
Summary
Although I don’t imagine this will be used often, it’s a feature that is there just in case, i imagine it will mostly be used in cases where compensation for transactions is required.
In the next version of Rapid Repository, there will be transactional support which should further remove the need for this feature, it will stay in though.
Sean McAlinden.