This commit is contained in:
Tizian.Breuch
2025-07-22 08:59:31 +02:00
parent 7100949276
commit 9429468424
7 changed files with 16 additions and 12 deletions

View File

@@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35122.118
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Webshop.Api", "Webshop.Api\Webshop.Api.csproj", "{CFC6D39C-5455-4091-8831-A07E34E1EF5F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Api", "Webshop.Api\Shop.Api.csproj", "{CFC6D39C-5455-4091-8831-A07E34E1EF5F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Webshop.Domain", "Webshop.Domain\Webshop.Domain.csproj", "{959C9FF8-13B2-43AD-9795-878D497EB975}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Domain", "Webshop.Domain\Shop.Domain.csproj", "{959C9FF8-13B2-43AD-9795-878D497EB975}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Webshop.Application", "Webshop.Application\Webshop.Application.csproj", "{48E0F59D-F70D-4AA7-895C-671AD939A4B9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Application", "Webshop.Application\Shop.Application.csproj", "{48E0F59D-F70D-4AA7-895C-671AD939A4B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Webshop.Infrastructure", "Webshop.Infrastructure\Webshop.Infrastructure.csproj", "{546165FB-7B73-40A5-B774-15CEDFEBB9E8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop.Infrastructure", "Webshop.Infrastructure\Shop.Infrastructure.csproj", "{546165FB-7B73-40A5-B774-15CEDFEBB9E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -19,8 +19,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Webshop.Application\Webshop.Application.csproj" />
<ProjectReference Include="..\Webshop.Infrastructure\Webshop.Infrastructure.csproj" />
<ProjectReference Include="..\Webshop.Application\Shop.Application.csproj" />
<ProjectReference Include="..\Webshop.Infrastructure\Shop.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Webshop.Domain\Webshop.Domain.csproj" />
<ProjectReference Include="..\Webshop.Domain\Shop.Domain.csproj" />
</ItemGroup>
</Project>

View File

@@ -10,5 +10,6 @@ namespace Webshop.Domain.Interfaces
Task AddProductAsync(Product product);
Task UpdateProductAsync(Product product);
Task DeleteProductAsync(Guid id);
Task<bool> ProductExistsBySlugAsync(string slug);
}
}

View File

@@ -28,8 +28,13 @@ namespace Webshop.Infrastructure.Repositories
public async Task AddProductAsync(Product product)
{
_context.Products.Add(product);
await _context.SaveChangesAsync(); // Wichtig: Änderungen speichern
await _context.Products.AddAsync(product);
await _context.SaveChangesAsync();
}
public async Task<bool> ProductExistsBySlugAsync(string slug)
{
return await _context.Products.AnyAsync(p => p.Slug == slug);
}
public async Task UpdateProductAsync(Product product)

View File

@@ -17,9 +17,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Webshop.Domain\Webshop.Domain.csproj" />
<ProjectReference Include="..\Webshop.Domain\Shop.Domain.csproj" />
</ItemGroup>
</Project>