naming
This commit is contained in:
@@ -16,14 +16,14 @@ namespace Webshop.Application.Services.Public
|
||||
_categorieRepository = categorieRepository;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<categorieDto>> GetAllActiveAsync()
|
||||
public async Task<IEnumerable<CategorieDto>> GetAllActiveAsync()
|
||||
{
|
||||
var categories = await _categorieRepository.GetAllAsync();
|
||||
|
||||
// Hier könnte man eine Baumstruktur aufbauen, für den Anfang eine flache Liste
|
||||
return categories
|
||||
.Where(c => c.IsActive)
|
||||
.Select(c => new categorieDto
|
||||
.Select(c => new CategorieDto
|
||||
{
|
||||
Id = c.Id,
|
||||
Name = c.Name,
|
||||
@@ -36,12 +36,12 @@ namespace Webshop.Application.Services.Public
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public async Task<categorieDto?> GetBySlugAsync(string slug)
|
||||
public async Task<CategorieDto?> GetBySlugAsync(string slug)
|
||||
{
|
||||
var categorie = await _categorieRepository.GetBySlugAsync(slug);
|
||||
if (categorie == null || !categorie.IsActive) return null;
|
||||
|
||||
return new categorieDto
|
||||
return new CategorieDto
|
||||
{
|
||||
Id = categorie.Id,
|
||||
Name = categorie.Name,
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Webshop.Application.Services.Public
|
||||
{
|
||||
public interface ICategorieService
|
||||
{
|
||||
Task<IEnumerable<categorieDto>> GetAllActiveAsync();
|
||||
Task<categorieDto?> GetBySlugAsync(string slug);
|
||||
Task<IEnumerable<CategorieDto>> GetAllActiveAsync();
|
||||
Task<CategorieDto?> GetBySlugAsync(string slug);
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace Webshop.Application.Services.Public
|
||||
ImageUrl = p.ImageUrl,
|
||||
IsInStock = p.IsInStock,
|
||||
Slug = p.Slug,
|
||||
categories = p.Productcategories.Select(pc => new categorieDto
|
||||
categories = p.Productcategories.Select(pc => new CategorieDto
|
||||
{
|
||||
Id = pc.categorie.Id,
|
||||
Name = pc.categorie.Name,
|
||||
@@ -73,7 +73,7 @@ namespace Webshop.Application.Services.Public
|
||||
ImageUrl = product.ImageUrl,
|
||||
IsInStock = product.IsInStock,
|
||||
Slug = product.Slug,
|
||||
categories = product.Productcategories.Select(pc => new categorieDto
|
||||
categories = product.Productcategories.Select(pc => new CategorieDto
|
||||
{
|
||||
Id = pc.categorie.Id,
|
||||
Name = pc.categorie.Name,
|
||||
|
||||
Reference in New Issue
Block a user