var paymentAttempt = _auctionContext.PaymentAttempts.Where(o => o.Id == paymentAttemptId).SingleOrDefault();
if (paymentAttempt != null)
{
paymentAttempt.PaymentAttemptStatusId = (int)PaymentAttemptStatus.Defunct;
paymentAttempt.PaymentAttemptStatus = _auctionContext.PaymentAttemptStatuses.Where(pas => pas.Id == paymentAttempt.PaymentAttemptStatusId).First();
var relevantWinningBidsTotalPrices = _auctionContext.GetWinningBidsTotalPricesForPaymentAttempt(paymentAttemptId).ToArray();
foreach (var winningBid in relevantWinningBidsTotalPrices)
{
winningBid.Locked = false;
_auctionContext.UpdateObject(winningBid);
}
_auctionContext.SaveChanges();
}
güncellememesi beklenen ancak paymentAttempt
olmadığından winningBid
güncellenir denir. Bu neden? Gerçekten sinir bozucu. Hata da yok. EF'in nesneyi veya benzeri bir şeyi takip etmemesi gibi bir problem olsaydı meydana gelememeyi umardım ama böyle bir hata olmaz.Varlık Framework SaveChanges()</p> <pre><code>_auctionContext.SaveChanges(); </code></pre> <p>sonra veritabanını Yukarıdaki kodda
Kullanım almak için Ekle senin değiştirilmiş varlık içeriği. Kaydetmeden önce. Bağlam ne hakkında konuştuğuna dair hiçbir fikrim yoktu. – Tabish