using CMSMicroservice.Protobuf.Protos.ProductCategory; using CMSMicroservice.WebApi.Common.Services; using CMSMicroservice.Application.ProductCategoryCQ.Commands.CreateNewProductCategory; using CMSMicroservice.Application.ProductCategoryCQ.Commands.UpdateProductCategory; using CMSMicroservice.Application.ProductCategoryCQ.Commands.DeleteProductCategory; using CMSMicroservice.Application.ProductCategoryCQ.Queries.GetProductCategory; using CMSMicroservice.Application.ProductCategoryCQ.Queries.GetAllProductCategoryByFilter; namespace CMSMicroservice.WebApi.Services; public class ProductCategoryService : ProductCategoryContract.ProductCategoryContractBase { private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS; public ProductCategoryService(IDispatchRequestToCQRS dispatchRequestToCQRS) { _dispatchRequestToCQRS = dispatchRequestToCQRS; } public override async Task CreateNewProductCategory(CreateNewProductCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task UpdateProductCategory(UpdateProductCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task DeleteProductCategory(DeleteProductCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task GetProductCategory(GetProductCategoryRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } public override async Task GetAllProductCategoryByFilter(GetAllProductCategoryByFilterRequest request, ServerCallContext context) { return await _dispatchRequestToCQRS.Handle(request, context); } }