Git Product home page Git Product logo

Comments (7)

PiotrFerenc avatar PiotrFerenc commented on August 30, 2024

change IRequest to ICommand and IRequestHandler to ICommandHandler

from convey.

b-y-t-e avatar b-y-t-e commented on August 30, 2024

Thanks for response, but ICommand does not have any result type, which is crucial for me.

from convey.

PiotrFerenc avatar PiotrFerenc commented on August 30, 2024

https://github.com/devmentors/Pacco.Services.Customers/blob/master/src/Pacco.Services.Customers.Application/Commands/Handlers/ChangeCustomerStateHandler.cs#L31

https://github.com/devmentors/Pacco.Services.Customers/tree/master/src/Pacco.Services.Customers.Core/Exceptions

from convey.

PiotrFerenc avatar PiotrFerenc commented on August 30, 2024
    class CreateOrderHandler : ICommandHandler<CreateOrderCommand>
    {
        public Task HandleAsync(CreateOrderCommand command)
        {
          return Task.FromResult(command.Id);
        }
    }

from convey.

b-y-t-e avatar b-y-t-e commented on August 30, 2024

Thanks for the answer! I know about ICommandHandler and ICommand interfaces (and I use them with no problem). However I would like to bend CQRS assumptions a little, and I would like that commands are able to return the value to the client. According to the documentation (https://convey-stack.github.io/documentation/Web-API/) IRequestHandler interface is ideal for this scenario, but the example from documentation does not work.

from convey.

Allann avatar Allann commented on August 30, 2024

I understand the frustration, I recently swapped in MediatR (https://www.nuget.org/packages/MediatR/) with success, maybe if you are blocked this could be a solution?.

from convey.

GooRiOn avatar GooRiOn commented on August 30, 2024

Neither of the CQRS packages provide you such thing, however there's the IRequestHandler<,> type beeing provided by WebAPI package along with its internal registration:

https://github.com/snatch-dev/Convey/blob/5b9a36606bad36d071461d984413f3c4e5adeca6/src/Convey.WebApi/src/Convey.WebApi/Requests/IRequestHandler.cs

builder.Services.Scan(s =>

from convey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.