2016-05-27 88 views
0

我有任何方式只更新我实体中的一些字段吗? 例如,我想在实体人中更新字段名称,而不发送完整的实体。 现在要更改我第一次请求它的实体,并在更改字段之后,我发送此实体进行更新。实体中的更新字段(属性)

回答

1

是的,你可以不更新等性能,通过使用合并实体插入或合并实体操作更新实体。

请参阅我们的样品表格存储here。他们演示了如何使用我们的客户端库合并实体。

下面是从.NET样本的摘录可能会有所帮助:

  // Create an instance of a customer entity. See the Model\CustomerEntity.cs for a description of the entity. 
     CustomerEntity customer = new CustomerEntity("Harp", "Walter") 
     { 
      Email = "[email protected]", 
      PhoneNumber = "425-555-0101" 
     }; 

     // Demonstrate how to Update the entity by changing the phone number 
     Console.WriteLine("2. Update an existing Entity using the InsertOrMerge Upsert Operation."); 
     customer.PhoneNumber = "425-555-0105"; 
     customer = await InsertOrMergeEntityAsync(table, customer); 

此外,请参阅REST API参考的合并实体插入或合并实体操作:

https://msdn.microsoft.com/en-us/library/azure/dd179392.aspx

https://msdn.microsoft.com/en-us/library/azure/hh452241.aspx

+1

好吧,如果我不知道字段电子邮件,并写入电子邮件null。在实体字段中操作“合并”后电子邮件将为空? – ZeViS