UseHiLo
This commit is contained in:
+6
-5
@@ -2,17 +2,18 @@
|
||||
using Vizhvizh.GoldGallery.ApplicationContract.Commands;
|
||||
using Vizhvizh.GoldGallery.Domain.Products.Entities;
|
||||
using Vizhvizh.GoldGallery.Domain.Products.Repositories;
|
||||
using Vizhvizh.GoldGallery.Domain.Products.ValuesObjects;
|
||||
|
||||
namespace Vizhvizh.GoldGallery.Application.CommandHandlers.Categories;
|
||||
|
||||
public class CreateCategoryCommandHandler(ICategoryRepository categoryRepository) : ICommandHandler<CreateCategoryCommand>
|
||||
{
|
||||
public Task Handle(CreateCategoryCommand request, CancellationToken cancellationToken)
|
||||
public async Task Handle(CreateCategoryCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//var category = Category.CreateNew(request.Title,
|
||||
// request.Description,
|
||||
// request.Image)
|
||||
var category = Category.CreateNew(request.Title,
|
||||
request.Description,
|
||||
request.Image, CategoryPath.CreateNew("/1/"));
|
||||
|
||||
throw new Exception();
|
||||
await categoryRepository.AddAsync(category, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user