test upload bild
All checks were successful
Branch - test - Build and Push Backend API Docker Image / build-and-push (push) Successful in 22s
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user