-
-
Notifications
You must be signed in to change notification settings - Fork 23
Convert Employee Commands to CSharpFunctionalExtensions #141
base: main
Are you sure you want to change the base?
Conversation
@@ -2,6 +2,7 @@ | |||
<PropertyGroup> | |||
<LangVersion>latest</LangVersion> | |||
<Nullable>enable</Nullable> | |||
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors> | |||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> | |||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍
namespace PayrollProcessor.Core.Domain.Intrastructure.Operations.Commands; | ||
|
||
/// <summary> | ||
/// TODO: Temporarily named after the Strangler Fig Pattern as this serves as an implementation of <see cref="ICommandDispatcher"/> migrating to CSharpFunctionalExtensions from LanguageExt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you done this kind of naming in a project before? I haven't but I like the idea of calling this type out explicitly. That way, you know it should eventually be renamed when it takes over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't done this before but the approach was mentioned in Code That Fits In Your Head and I couldn't think of a better name so I figured calling it out explicitly would be best while the code is in migration state.
@@ -34,7 +35,7 @@ public EmployeeCreate(ICommandDispatcher dispatcher, IEntityIdGenerator generato | |||
OperationId = "Employees.Create", | |||
Tags = new[] { "Employees" }) | |||
] | |||
public override Task<ActionResult<Employee>> HandleAsync([FromBody] EmployeeCreateRequest request, CancellationToken token) | |||
public override ActionResult<Employee> Handle([FromBody] EmployeeCreateRequest request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you drop the Async
suffix most of the time now? I think Microsoft s current guidance is to only use it if there is also an existing sync API of the same name...
But I've seen a lot of modern code go both ways.
Description
Purpose
Change Type
Data Persistence Changes
N/A
Configuration Changes
N/A