test upload bild
All checks were successful
Branch - test - Build and Push Backend API Docker Image / build-and-push (push) Successful in 22s

This commit is contained in:
Tizian.Breuch
2025-11-07 10:30:52 +01:00
parent 4d4d7b730a
commit 3f1874f7c2
3 changed files with 9 additions and 3 deletions

View File

@@ -49,8 +49,14 @@ namespace Webshop.Infrastructure.Repositories
}
// --- KORRIGIERTE UPDATE-METHODE (OHNE PARAMETER) ---
public async Task UpdateProductAsync()
public async Task UpdateProductAsync(Product product)
{
// Wir sagen dem DbContext explizit, dass der Zustand dieser Entität "Modifiziert" ist.
// Das zwingt EF Core dazu, ALLE Eigenschaften der Entität in der UPDATE-Anweisung zu berücksichtigen.
// Es umgeht alle möglichen Probleme mit dem Change Tracking, die durch verschiedene Kontexte
// oder komplexe Beziehungs-Updates entstehen können.
_context.Entry(product).State = EntityState.Modified;
await _context.SaveChangesAsync();
}