1
エンティティを削除しようとするとVisual Studioは "serviceContext.DeleteObject(entity);"という行でクラッシュし続け、 "コンテキストが現在エンティティを追跡していません。誰にも何らかのアイディアがあり、それを修正する方法は?エンティティがAzureテーブルから削除されない
CloudTableQuery<ScheduleEntity> query = scheduleManNot.retrieveSchedule();
//Checks every entry
foreach (ScheduleEntity entity in query)
{
comparison = System.DateTime.Compare(entity.eventTime, time);
if (comparison <= 0)
{
changeConfirmation = scheduleManNot.changeInstanceCount(entity.subscriptionID, entity.amount, entity.serviceName);
if (changeConfirmation == false)
{
Console.WriteLine("Configuration Change failed");
}
if (changeConfirmation == true)
{
Console.WriteLine("Configuration Change Succeeded");
Console.WriteLine(entity.serviceName + " had its instance count changed to " + entity.amount);
serviceContext.AttachTo("schedule", entity, "*");
serviceContext.DeleteObject(entity);
//Submit the operation to the table service
serviceContext.SaveChangesWithRetries();
私はチェックし、 "スケジュール"は正しいデータセットです。正直言って私は、AttachToがどのように動作しているのか、私はまったく確信しています。オブジェクトを削除します。私はそれをしないでください。 – StevenR
私は答えを更新しました。 – daryal
attachToを取り出しても同じエラーが発生する – StevenR