例如,我有一个<编码>bool? 现况: c
当<代码>Status =真实/false时,它可以节省到桌旁,没有问题。
But when Stats = null
, it cannot save(update) to Azure table, the column still keeps the old value
I guess it might because Azure table does not have a scheme, but whats the solution?
如何拯救<>null至overwrite原始价值?
EDIT, the code
类似数据:
public class someEntity : TableServiceEntity
{
public bool? Status { get; set; }
}
update like this:
tableContext.AttachTo("sometable", someEntity);
tableContext.UpdateObject(someEntity);
tableContext.SaveChangesWithRetries(SaveChangesOptions.Batch & SaveChangesOptions.ReplaceOnUpdate);
(I Trial AttachTo
with >*>,
as etag,tries out SaveChangesOptions
, both work)
SORRY for my stupid, should be this code, then works
tableContext.SaveChangesWithRetries(SaveChangesOptions.Batch | SaveChangesOptions.ReplaceOnUpdate);