Compare commits
1 Commits
e42c4d6741
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03993211f6 |
@@ -5,7 +5,7 @@ name: Branch - test - Build and Push Backend API Docker Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop # Wird ausgelöst bei jedem Push auf den Master-Branch
|
||||
- test # Wird ausgelöst bei jedem Push auf den Master-Branch
|
||||
|
||||
# Definition der Jobs, die in diesem Workflow ausgeführt werden
|
||||
jobs:
|
||||
|
||||
@@ -77,12 +77,15 @@ namespace Webshop.Api.Controllers.Admin
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)]
|
||||
public async Task<IActionResult> UpdateAdminProduct(Guid id, [FromForm] UpdateAdminProductDto productDto)
|
||||
{
|
||||
// ==============================================================================
|
||||
// DEINE PERFEKTE L<>SUNG: URL-ID erzwingen
|
||||
// ==============================================================================
|
||||
productDto.Id = id;
|
||||
if (id != productDto.Id)
|
||||
{
|
||||
return BadRequest(new { Message = "ID in der URL und im Body stimmen nicht <20>berein." });
|
||||
}
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
// Jetzt den Service mit dem garantiert korrekten DTO aufrufen.
|
||||
var result = await _adminProductService.UpdateAdminProductAsync(productDto);
|
||||
|
||||
return result.Type switch
|
||||
@@ -90,7 +93,8 @@ namespace Webshop.Api.Controllers.Admin
|
||||
ServiceResultType.Success => NoContent(),
|
||||
ServiceResultType.NotFound => NotFound(new { Message = result.ErrorMessage }),
|
||||
ServiceResultType.Conflict => Conflict(new { Message = result.ErrorMessage }),
|
||||
_ => BadRequest(new { Message = result.ErrorMessage ?? "Ein Fehler ist aufgetreten." })
|
||||
ServiceResultType.InvalidInput => BadRequest(new { Message = result.ErrorMessage }),
|
||||
_ => StatusCode(StatusCodes.Status500InternalServerError, new { Message = result.ErrorMessage ?? "Ein unerwarteter Fehler ist aufgetreten." })
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,6 @@ builder.Services.AddControllers()
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
|
||||
options.JsonSerializerOptions.DefaultIgnoreCondition =
|
||||
System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull;
|
||||
});
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
|
||||
@@ -329,6 +327,6 @@ app.Run();
|
||||
|
||||
|
||||
|
||||
//new image build
|
||||
//new git
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,5 @@ namespace Webshop.Application.DTOs.Products
|
||||
// << NEU >>
|
||||
public bool IsFeatured { get; set; }
|
||||
public int FeaturedDisplayOrder { get; set; }
|
||||
public byte[] RowVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,12 @@ namespace Webshop.Application.DTOs.Products
|
||||
[Required]
|
||||
public string Slug { get; set; }
|
||||
|
||||
// << ZURÜCK ZU IFormFile >>
|
||||
public IFormFile? MainImageFile { get; set; }
|
||||
public List<IFormFile>? AdditionalImageFiles { get; set; }
|
||||
public List<Guid>? ImagesToDelete { get; set; }
|
||||
|
||||
public Guid? SetMainImageId { get; set; }
|
||||
|
||||
public List<Guid>? CategorieIds { get; set; } = new List<Guid>();
|
||||
public List<Guid> CategorieIds { get; set; } = new List<Guid>();
|
||||
|
||||
public decimal? Weight { get; set; }
|
||||
public decimal? OldPrice { get; set; }
|
||||
@@ -36,7 +35,5 @@ namespace Webshop.Application.DTOs.Products
|
||||
public decimal? PurchasePrice { get; set; }
|
||||
public bool IsFeatured { get; set; }
|
||||
public int FeaturedDisplayOrder { get; set; }
|
||||
|
||||
public string? RowVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -100,8 +100,7 @@ namespace Webshop.Application.Services.Admin
|
||||
IsFeatured = productDto.IsFeatured,
|
||||
FeaturedDisplayOrder = productDto.FeaturedDisplayOrder,
|
||||
Images = images,
|
||||
Productcategories = productDto.CategorieIds.Select(cId => new Productcategorie { categorieId = cId }).ToList(),
|
||||
RowVersion = Guid.NewGuid().ToByteArray()
|
||||
Productcategories = productDto.CategorieIds.Select(cId => new Productcategorie { categorieId = cId }).ToList()
|
||||
};
|
||||
|
||||
await _productRepository.AddProductAsync(newProduct);
|
||||
@@ -110,208 +109,20 @@ namespace Webshop.Application.Services.Admin
|
||||
|
||||
// ... (UpdateAdminProductAsync und DeleteAdminProductAsync und MapToAdminDto bleiben unver<65>ndert) ...
|
||||
#region Unchanged Methods
|
||||
// src/Webshop.Application/Services/Admin/AdminProductService.cs
|
||||
|
||||
public async Task<ServiceResult> UpdateAdminProductAsync(UpdateAdminProductDto productDto)
|
||||
{
|
||||
Console.WriteLine($"---- UPDATE START: Produkt-ID {productDto.Id} ----");
|
||||
|
||||
// 1. Produkt laden (nur um sicherzugehen, dass es existiert und f<>r alte Bilder)
|
||||
var existingProduct = await _context.Products
|
||||
.Include(p => p.Images)
|
||||
.Include(p => p.Productcategories)
|
||||
.FirstOrDefaultAsync(p => p.Id == productDto.Id);
|
||||
|
||||
if (existingProduct == null)
|
||||
{
|
||||
return ServiceResult.Fail(ServiceResultType.NotFound, $"Produkt nicht gefunden.");
|
||||
}
|
||||
|
||||
// 2. Optionaler Concurrency Check
|
||||
if (!string.IsNullOrEmpty(productDto.RowVersion))
|
||||
{
|
||||
string dbRowVersion = Convert.ToBase64String(existingProduct.RowVersion ?? new byte[0]);
|
||||
string incomingRowVersion = productDto.RowVersion.Trim().Replace(" ", "+");
|
||||
|
||||
if (dbRowVersion != incomingRowVersion)
|
||||
{
|
||||
Console.WriteLine("!!! KONFLIKT: Versionen unterschiedlich !!!");
|
||||
return ServiceResult.Fail(ServiceResultType.Conflict, "Das Produkt wurde zwischenzeitlich bearbeitet.");
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// SCHRITT A: BILDER UPDATE (DIREKT AM CONTEXT)
|
||||
// -----------------------------------------------------------------------
|
||||
bool imagesChanged = false;
|
||||
|
||||
// A1. Bilder l<>schen
|
||||
if (productDto.ImagesToDelete != null && productDto.ImagesToDelete.Any())
|
||||
{
|
||||
// Wir suchen die zu l<>schenden Bilder direkt im Context
|
||||
var imagesToRemove = existingProduct.Images.Where(img => productDto.ImagesToDelete.Contains(img.Id)).ToList();
|
||||
if (imagesToRemove.Any())
|
||||
{
|
||||
_context.ProductImages.RemoveRange(imagesToRemove);
|
||||
imagesChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Hilfsfunktion um saubere neue Bilder zu erstellen
|
||||
ProductImage CreateNewImage(string url, bool isMain, int order)
|
||||
{
|
||||
return new ProductImage
|
||||
{
|
||||
Id = Guid.NewGuid(), // WICHTIG: Neue ID client-seitig generieren
|
||||
ProductId = existingProduct.Id, // WICHTIG: Explizite Zuordnung zum Produkt
|
||||
Url = url,
|
||||
IsMainImage = isMain,
|
||||
DisplayOrder = order
|
||||
};
|
||||
}
|
||||
|
||||
// A2. Hauptbild
|
||||
if (productDto.MainImageFile != null)
|
||||
{
|
||||
// Altes Hauptbild finden und l<>schen
|
||||
var existingMainImage = existingProduct.Images.FirstOrDefault(img => img.IsMainImage);
|
||||
if (existingMainImage != null)
|
||||
{
|
||||
_context.ProductImages.Remove(existingMainImage);
|
||||
}
|
||||
|
||||
await using var stream = productDto.MainImageFile.OpenReadStream();
|
||||
var url = await _fileStorageService.SaveFileAsync(stream, productDto.MainImageFile.FileName, productDto.MainImageFile.ContentType);
|
||||
|
||||
// NEU: Direktes Hinzuf<75>gen zum Context (Umgeht Collection-Tracking Probleme)
|
||||
var newMainImage = CreateNewImage(url, true, 1);
|
||||
_context.ProductImages.Add(newMainImage);
|
||||
|
||||
imagesChanged = true;
|
||||
}
|
||||
// >>> NEU: A2.5 Szenario: BESTEHENDES Bild als Hauptbild <<<
|
||||
else if (productDto.SetMainImageId.HasValue)
|
||||
{
|
||||
// Wir suchen das Bild in der Liste, die wir schon aus der DB geladen haben
|
||||
var targetImage = existingProduct.Images.FirstOrDefault(img => img.Id == productDto.SetMainImageId.Value);
|
||||
|
||||
// Nur ausf<73>hren, wenn Bild existiert und noch nicht Main ist
|
||||
if (targetImage != null && !targetImage.IsMainImage)
|
||||
{
|
||||
Console.WriteLine($"---- Setze existierendes Bild {targetImage.Id} als MAIN ----");
|
||||
|
||||
// 1. Alle Bilder auf "Nicht-Main" setzen
|
||||
foreach (var img in existingProduct.Images)
|
||||
{
|
||||
img.IsMainImage = false;
|
||||
// Optional: Ordnung korrigieren, damit Main immer vorne ist
|
||||
if (img.DisplayOrder == 1) img.DisplayOrder = 2;
|
||||
}
|
||||
|
||||
// 2. Das gew<65>hlte Bild auf Main setzen
|
||||
targetImage.IsMainImage = true;
|
||||
targetImage.DisplayOrder = 1;
|
||||
|
||||
// Da wir hier getrackte Entities <20>ndern, generiert EF Core automatisch UPDATEs
|
||||
imagesChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// A3. Zusatzbilder
|
||||
if (productDto.AdditionalImageFiles != null && productDto.AdditionalImageFiles.Any())
|
||||
{
|
||||
// H<>chste DisplayOrder ermitteln (sicher gegen NullReference)
|
||||
int currentMaxOrder = existingProduct.Images.Any() ? existingProduct.Images.Max(i => i.DisplayOrder) : 0;
|
||||
int displayOrder = currentMaxOrder + 1;
|
||||
|
||||
foreach (var file in productDto.AdditionalImageFiles)
|
||||
{
|
||||
await using var stream = file.OpenReadStream();
|
||||
var url = await _fileStorageService.SaveFileAsync(stream, file.FileName, file.ContentType);
|
||||
|
||||
// NEU: Direktes Hinzuf<75>gen zum Context
|
||||
var newAdditionalImage = CreateNewImage(url, false, displayOrder++);
|
||||
_context.ProductImages.Add(newAdditionalImage);
|
||||
}
|
||||
imagesChanged = true;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// SCHRITT A SPEICHERN
|
||||
// -----------------------------------------------------------------------
|
||||
if (imagesChanged)
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine("---- SPEICHERE BILDER (Context Add) ----");
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
// WICHTIG: State neu laden f<>r Schritt B
|
||||
// Wir m<>ssen dem Context sagen, dass existingProduct neu geladen werden soll,
|
||||
// damit die Navigations-Properties (Images) wieder aktuell sind.
|
||||
await _context.Entry(existingProduct).ReloadAsync();
|
||||
|
||||
// Da wir die Collection umgangen haben, m<>ssen wir sie explizit neu laden
|
||||
await _context.Entry(existingProduct).Collection(p => p.Images).LoadAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Fehler Bild-Save: {ex.Message}");
|
||||
// Inner Exception loggen, falls vorhanden
|
||||
if (ex.InnerException != null) Console.WriteLine($"Inner: {ex.InnerException.Message}");
|
||||
|
||||
return ServiceResult.Fail(ServiceResultType.Failure, "Fehler beim Speichern der Bilder.");
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// SCHRITT B: PRODUKT EIGENSCHAFTEN
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// Kategorien update
|
||||
if (productDto.CategorieIds != null)
|
||||
{
|
||||
var currentIds = existingProduct.Productcategories.Select(pc => pc.categorieId).ToList();
|
||||
if (!new HashSet<Guid>(currentIds).SetEquals(productDto.CategorieIds))
|
||||
{
|
||||
existingProduct.Productcategories.Clear();
|
||||
foreach (var cId in productDto.CategorieIds)
|
||||
{
|
||||
existingProduct.Productcategories.Add(new Productcategorie { categorieId = cId });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Mapping
|
||||
existingProduct.Name = productDto.Name;
|
||||
existingProduct.Description = productDto.Description;
|
||||
existingProduct.SKU = productDto.SKU;
|
||||
existingProduct.Price = productDto.Price;
|
||||
existingProduct.IsActive = productDto.IsActive;
|
||||
existingProduct.StockQuantity = productDto.StockQuantity;
|
||||
existingProduct.Slug = productDto.Slug;
|
||||
existingProduct.Weight = productDto.Weight;
|
||||
existingProduct.OldPrice = productDto.OldPrice;
|
||||
existingProduct.SupplierId = productDto.SupplierId;
|
||||
existingProduct.PurchasePrice = productDto.PurchasePrice;
|
||||
existingProduct.IsFeatured = productDto.IsFeatured;
|
||||
existingProduct.FeaturedDisplayOrder = productDto.FeaturedDisplayOrder;
|
||||
|
||||
// Metadaten
|
||||
existingProduct.LastModifiedDate = DateTimeOffset.UtcNow;
|
||||
existingProduct.RowVersion = Guid.NewGuid().ToByteArray();
|
||||
|
||||
try
|
||||
{
|
||||
Console.WriteLine("---- SPEICHERE PRODUKT-DATEN ----");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
return ServiceResult.Fail(ServiceResultType.Conflict, "Konflikt beim Speichern der Produktdaten.");
|
||||
}
|
||||
|
||||
return ServiceResult.Ok();
|
||||
var existingProduct = await _context.Products.Include(p => p.Images).Include(p => p.Productcategories).FirstOrDefaultAsync(p => p.Id == productDto.Id);
|
||||
if (existingProduct == null) { return ServiceResult.Fail(ServiceResultType.NotFound, $"Produkt mit ID '{productDto.Id}' nicht gefunden."); }
|
||||
var skuExists = await _context.Products.AnyAsync(p => p.SKU == productDto.SKU && p.Id != productDto.Id);
|
||||
if (skuExists) { return ServiceResult.Fail(ServiceResultType.Conflict, $"Ein anderes Produkt mit der SKU '{productDto.SKU}' existiert bereits."); }
|
||||
var slugExists = await _context.Products.AnyAsync(p => p.Slug == productDto.Slug && p.Id != productDto.Id);
|
||||
if (slugExists) { return ServiceResult.Fail(ServiceResultType.Conflict, $"Ein anderes Produkt mit dem Slug '{productDto.Slug}' existiert bereits."); }
|
||||
if (productDto.ImagesToDelete != null && productDto.ImagesToDelete.Any()) { var imagesToRemove = existingProduct.Images.Where(img => productDto.ImagesToDelete.Contains(img.Id)).ToList(); _context.ProductImages.RemoveRange(imagesToRemove); }
|
||||
if (productDto.MainImageFile != null) { var existingMainImage = existingProduct.Images.FirstOrDefault(img => img.IsMainImage); if (existingMainImage != null) _context.ProductImages.Remove(existingMainImage); await using var stream = productDto.MainImageFile.OpenReadStream(); var url = await _fileStorageService.SaveFileAsync(stream, productDto.MainImageFile.FileName, productDto.MainImageFile.ContentType); existingProduct.Images.Add(new ProductImage { Url = url, IsMainImage = true, DisplayOrder = 1 }); }
|
||||
if (productDto.AdditionalImageFiles != null && productDto.AdditionalImageFiles.Any()) { int displayOrder = (existingProduct.Images.Any() ? existingProduct.Images.Max(i => i.DisplayOrder) : 0) + 1; foreach (var file in productDto.AdditionalImageFiles) { await using var stream = file.OpenReadStream(); var url = await _fileStorageService.SaveFileAsync(stream, file.FileName, file.ContentType); existingProduct.Images.Add(new ProductImage { Url = url, IsMainImage = false, DisplayOrder = displayOrder++ }); } }
|
||||
existingProduct.Name = productDto.Name; existingProduct.Description = productDto.Description; existingProduct.SKU = productDto.SKU; existingProduct.Price = productDto.Price; existingProduct.IsActive = productDto.IsActive; existingProduct.StockQuantity = productDto.StockQuantity; existingProduct.Slug = productDto.Slug; existingProduct.Weight = productDto.Weight; existingProduct.OldPrice = productDto.OldPrice; existingProduct.SupplierId = productDto.SupplierId; existingProduct.PurchasePrice = productDto.PurchasePrice; existingProduct.LastModifiedDate = DateTimeOffset.UtcNow; existingProduct.IsFeatured = productDto.IsFeatured; existingProduct.FeaturedDisplayOrder = productDto.FeaturedDisplayOrder;
|
||||
existingProduct.Productcategories.Clear(); if (productDto.CategorieIds != null) { foreach (var categorieId in productDto.CategorieIds) { existingProduct.Productcategories.Add(new Productcategorie { categorieId = categorieId }); } }
|
||||
await _productRepository.UpdateProductAsync(existingProduct); return ServiceResult.Ok();
|
||||
}
|
||||
|
||||
public async Task<ServiceResult> DeleteAdminProductAsync(Guid id)
|
||||
@@ -323,7 +134,7 @@ namespace Webshop.Application.Services.Admin
|
||||
|
||||
private AdminProductDto MapToAdminDto(Product product)
|
||||
{
|
||||
return new AdminProductDto { Id = product.Id, Name = product.Name, Description = product.Description, SKU = product.SKU, Price = product.Price, OldPrice = product.OldPrice, IsActive = product.IsActive, IsInStock = product.IsInStock, StockQuantity = product.StockQuantity, Weight = product.Weight, Slug = product.Slug, CreatedDate = product.CreatedDate, LastModifiedDate = product.LastModifiedDate, SupplierId = product.SupplierId, PurchasePrice = product.PurchasePrice, IsFeatured = product.IsFeatured, FeaturedDisplayOrder = product.FeaturedDisplayOrder, categorieIds = product.Productcategories.Select(pc => pc.categorieId).ToList(), Images = product.Images.OrderBy(i => i.DisplayOrder).Select(img => new ProductImageDto { Id = img.Id, Url = img.Url, IsMainImage = img.IsMainImage, DisplayOrder = img.DisplayOrder }).ToList(), RowVersion = product.RowVersion };
|
||||
return new AdminProductDto { Id = product.Id, Name = product.Name, Description = product.Description, SKU = product.SKU, Price = product.Price, OldPrice = product.OldPrice, IsActive = product.IsActive, IsInStock = product.IsInStock, StockQuantity = product.StockQuantity, Weight = product.Weight, Slug = product.Slug, CreatedDate = product.CreatedDate, LastModifiedDate = product.LastModifiedDate, SupplierId = product.SupplierId, PurchasePrice = product.PurchasePrice, IsFeatured = product.IsFeatured, FeaturedDisplayOrder = product.FeaturedDisplayOrder, categorieIds = product.Productcategories.Select(pc => pc.categorieId).ToList(), Images = product.Images.OrderBy(i => i.DisplayOrder).Select(img => new ProductImageDto { Id = img.Id, Url = img.Url, IsMainImage = img.IsMainImage, DisplayOrder = img.DisplayOrder }).ToList() };
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -53,7 +53,5 @@ namespace Webshop.Domain.Entities
|
||||
public virtual ICollection<ProductDiscount> ProductDiscounts { get; set; } = new List<ProductDiscount>();
|
||||
public virtual ICollection<Productcategorie> Productcategories { get; set; } = new List<Productcategorie>();
|
||||
public virtual ICollection<ProductImage> Images { get; set; } = new List<ProductImage>();
|
||||
[ConcurrencyCheck]
|
||||
public byte[] RowVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ namespace Webshop.Domain.Interfaces
|
||||
Task<Product?> GetBySlugAsync(string slug);
|
||||
Task AddProductAsync(Product product);
|
||||
Task UpdateProductAsync(Product product);
|
||||
Task SaveChangesAsync();
|
||||
Task DeleteProductAsync(Guid id);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Webshop.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class row : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<byte[]>(
|
||||
name: "RowVersion",
|
||||
table: "Products",
|
||||
type: "bytea",
|
||||
rowVersion: true,
|
||||
nullable: false,
|
||||
defaultValue: new byte[0]);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RowVersion",
|
||||
table: "Products");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Webshop.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class rowversion : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Webshop.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class rowversion2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Webshop.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class rowversion3 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Webshop.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class rowversion4 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -613,11 +613,6 @@ namespace Webshop.Infrastructure.Migrations
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("numeric(18,2)");
|
||||
|
||||
b.Property<byte[]>("RowVersion")
|
||||
.IsConcurrencyToken()
|
||||
.IsRequired()
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<string>("SKU")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
|
||||
@@ -55,9 +55,5 @@ namespace Webshop.Infrastructure.Repositories
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
public async Task SaveChangesAsync()
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user