Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about how to manage multiple user interface #39

Open
Blackleones opened this issue Mar 20, 2020 · 1 comment
Open

Question about how to manage multiple user interface #39

Blackleones opened this issue Mar 20, 2020 · 1 comment

Comments

@Blackleones
Copy link

I've come here from your presentation of "Vertical Slice Architecture" at NDC Sydney.

I've noticed that all the codes strictly related to accomplishing a specific request are in the same folder/file.

For example all the code related to Create student is into Create.cshtml.cs file, that contains:

  • user interface specification,
  • command model,
  • command validator,
  • command handler,
  • command mapper to an entity.

I was wondering about "What about if I want to create a WebApi/Blazor/(another user interface) entry point with the same request? Do I have to 'copy and paste' the code inside the Create.cshtml.cs file or can I take out this logic and create a common endpoint?"

@jbogard
Copy link
Owner

jbogard commented Mar 30, 2020

In that case, you'd handle the duplication as you would anything else inside handlers. You don't want to re-use requests and handlers, though. There might be subtle differences that you can't predict between an API and Razor Page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants