For example, I have a bool? Status
in c#
when the Status = true/false
, it can save to Azure table, no problem
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?
How to save a null to overwrite the original value?
EDIT, the code
data like this:
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 tried AttachTo
with "*"
as etag, tried remove SaveChangesOptions
, neither work)
SORRY for my stupid, should be this code, then works
tableContext.SaveChangesWithRetries(SaveChangesOptions.Batch | SaveChangesOptions.ReplaceOnUpdate);