Exportar (0) Imprimir
Expandir todo
Este contenido no se encuentra disponible en su idioma, pero aquí tiene la versión en inglés.

TableServiceContext.SaveChangesWithRetries Method ()

Updated: April 24, 2013

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Saves changes to the Table service, using the retry policy specified for the TableServiceContext object.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

Dim instance As TableServiceContext
Dim returnValue As DataServiceResponse

returnValue = instance.SaveChangesWithRetries

public DataServiceResponse SaveChangesWithRetries ()

Return Value

Type: System.Data.Services.Client.DataServiceResponse

A DataServiceResponse that represents the result of the operation.

The following code example inserts an entity into a table.

public static void InsertContact(CloudTableClient tableClient, string firstName, string lastName, string email,
    string cellPhone, string homePhone, string streetAddress, string city, string state, string zipCode)
    // Get data context.
    TableServiceContext context = tableClient.GetDataServiceContext();

    // Create the new entity.
    ContactEntity entity = new ContactEntity();

    // Partition key is first letter of contact's first name.
    entity.PartitionKey = firstName.Substring(0, 1).ToUpper();

    // Row key is value of first name, with GUID appended to avoid conflicts in case where two first names are the same.
    entity.RowKey = firstName + "_" + Guid.NewGuid().ToString();

    // Populate the other properties.
    entity.FirstName = firstName;
    entity.LastName = lastName;
    entity.Email = email;
    entity.CellPhone = cellPhone;
    entity.HomePhone = homePhone;
    entity.StreetAddress = streetAddress;
    entity.City = city;
    entity.State = state;
    entity.ZipCode = zipCode;

    // Add the entity.
    context.AddObject(tableName, entity);

    // Save changes to the service.

public class ContactEntity : TableServiceEntity
    public ContactEntity()

    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Email { get; set; }
    public string HomePhone { get; set; }
    public string CellPhone { get; set; }
    public string StreetAddress { get; set; }
    public string City { get; set; }
    public string State { get; set; }
    public string ZipCode { get; set; }

The SaveChangesWithRetries method behaves in the same manner as the SaveChanges method, with the addition of retries as specified by the RetryPolicy property.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012


© 2014 Microsoft