Session: How to defer operations?

Operations can be deferred till SaveChanges is called by using Defer method in Advanced session operations. There are four types of commands that can be deferred:

Syntax

void Defer(params ICommandData[] commands);
Parameters
ICommandData[] Array of commands implementing ICommandData interface.  

Example

session
	.Advanced
	.Defer(
		new PutCommandData
			{
				Key = "products/999",
				Document = RavenJObject.FromObject(new Product
													   {
														   Name = "My Product", 
														   Supplier = "suppliers/999"
													   }),
				Metadata = new RavenJObject()
			},
		new PutCommandData
			{
				Key = "suppliers/999",
				Document = RavenJObject.FromObject(new Supplier
													   {
														   Name = "My Supplier",
													   }),
				Metadata = new RavenJObject()
			},
		new DeleteCommandData
			{
				Key = "products/1"
			});