Try using the following SaveChanges()
and provide ReplaceOnUpdate
as the SaveChangesOption. Something like:
user.PictureUri = null;
tableServiceContext.AttachTo(TableNames.User, user);
tableServiceContext.Update(user);
tableServiceContext.SaveChanges(SaveChangesOption.ReplaceOnUpdate);
tableServiceContext.Detach(user);
I think what's happening is that the default save option is "Merge" where it does not change the values which are not passed (i.e. passed as null).
Other option could be to set user.Picture1
to String.Empty
instead of null
.