Skip to content

Commit

Permalink
Fix casing on _handleBehavior (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin authored Jan 16, 2024
1 parent 25e74f7 commit 081da86
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions src/Immediate.Handlers.Generators/Templates/Handler.sbntxt
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ partial class {{ class_name }}
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<{{ request_type }}, {{ response_type }}>
{
private readonly {{ class_fully_qualified_name }}.HandleBehavior _HandleBehavior;
private readonly {{ class_fully_qualified_name }}.HandleBehavior _handleBehavior;
{{~ for behavior in (behaviors | array.reverse) ~}}
private readonly {{ behavior.non_generic_type_name }}<{{ request_type }}, {{ response_type }}> _{{ behavior.variable_name }};
{{~ end ~}}

public Handler(
{{ class_fully_qualified_name }}.HandleBehavior HandleBehavior{{ if behaviors.size > 0 }},{{ end }}
{{ class_fully_qualified_name }}.HandleBehavior handleBehavior{{ if behaviors.size > 0 }},{{ end }}
{{~ for behavior in (behaviors | array.reverse) ~}}
{{ behavior.non_generic_type_name }}<{{ request_type }}, {{ response_type }}> {{ behavior.variable_name }}{{ if !for.last }},{{end }}
{{~ end ~}}
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;
{{~ for behavior in behaviors ~}}
_{{ behavior.variable_name }} = {{ behavior.variable_name }};
{{~ end ~}}

{{~ for behavior in (behaviors | array.reverse) ~}}
{{~ if for.first ~}}
_{{ behavior.variable_name }}.SetInnerHandler(_HandleBehavior);
_{{ behavior.variable_name }}.SetInnerHandler(_handleBehavior);
{{~ else ~}}
_{{ behavior.variable_name }}.SetInnerHandler(_{{ behaviors[behaviors.size - for.index].variable_name }});
{{~ end ~}}
Expand All @@ -48,7 +48,7 @@ partial class {{ class_name }}
.HandleAsync(request, cancellationToken)
.ConfigureAwait(false);
{{~ else ~}}
return await _HandleBehavior
return await _handleBehavior
.HandleAsync(request, cancellationToken)
.ConfigureAwait(false);
{{~ end ~}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ partial class GetUsersQuery
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>>
{
private readonly global::Dummy.GetUsersQuery.HandleBehavior _HandleBehavior;
private readonly global::Dummy.GetUsersQuery.HandleBehavior _handleBehavior;
private readonly global::YetAnotherDummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _secondLoggingBehavior1;
private readonly global::YetAnotherDummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _loggingBehavior1;
private readonly global::Dummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _secondLoggingBehavior;
private readonly global::YetAnotherDummy.OtherBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _otherBehavior;
private readonly global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _loggingBehavior;

public Handler(
global::Dummy.GetUsersQuery.HandleBehavior HandleBehavior,
global::Dummy.GetUsersQuery.HandleBehavior handleBehavior,
global::YetAnotherDummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> secondLoggingBehavior1,
global::YetAnotherDummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> loggingBehavior1,
global::Dummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> secondLoggingBehavior,
global::YetAnotherDummy.OtherBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> otherBehavior,
global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> loggingBehavior
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;
_loggingBehavior = loggingBehavior;
_otherBehavior = otherBehavior;
_secondLoggingBehavior = secondLoggingBehavior;
_loggingBehavior1 = loggingBehavior1;
_secondLoggingBehavior1 = secondLoggingBehavior1;

_secondLoggingBehavior1.SetInnerHandler(_HandleBehavior);
_secondLoggingBehavior1.SetInnerHandler(_handleBehavior);
_loggingBehavior1.SetInnerHandler(_secondLoggingBehavior1);
_secondLoggingBehavior.SetInnerHandler(_loggingBehavior1);
_otherBehavior.SetInnerHandler(_secondLoggingBehavior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ partial class GetUsersQuery
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>>
{
private readonly global::Dummy.GetUsersQuery.HandleBehavior _HandleBehavior;
private readonly global::Dummy.GetUsersQuery.HandleBehavior _handleBehavior;
private readonly global::YetAnotherDummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _secondLoggingBehavior1;
private readonly global::YetAnotherDummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _loggingBehavior1;
private readonly global::Dummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _secondLoggingBehavior;
private readonly global::YetAnotherDummy.OtherBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _otherBehavior;
private readonly global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _loggingBehavior;

public Handler(
global::Dummy.GetUsersQuery.HandleBehavior HandleBehavior,
global::Dummy.GetUsersQuery.HandleBehavior handleBehavior,
global::YetAnotherDummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> secondLoggingBehavior1,
global::YetAnotherDummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> loggingBehavior1,
global::Dummy.SecondLoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> secondLoggingBehavior,
global::YetAnotherDummy.OtherBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> otherBehavior,
global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> loggingBehavior
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;
_loggingBehavior = loggingBehavior;
_otherBehavior = otherBehavior;
_secondLoggingBehavior = secondLoggingBehavior;
_loggingBehavior1 = loggingBehavior1;
_secondLoggingBehavior1 = secondLoggingBehavior1;

_secondLoggingBehavior1.SetInnerHandler(_HandleBehavior);
_secondLoggingBehavior1.SetInnerHandler(_handleBehavior);
_loggingBehavior1.SetInnerHandler(_secondLoggingBehavior1);
_secondLoggingBehavior.SetInnerHandler(_loggingBehavior1);
_otherBehavior.SetInnerHandler(_secondLoggingBehavior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ partial class GetUsersQuery
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>>
{
private readonly global::Dummy.GetUsersQuery.HandleBehavior _HandleBehavior;
private readonly global::Dummy.GetUsersQuery.HandleBehavior _handleBehavior;
private readonly global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _loggingBehavior;

public Handler(
global::Dummy.GetUsersQuery.HandleBehavior HandleBehavior,
global::Dummy.GetUsersQuery.HandleBehavior handleBehavior,
global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> loggingBehavior
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;
_loggingBehavior = loggingBehavior;

_loggingBehavior.SetInnerHandler(_HandleBehavior);
_loggingBehavior.SetInnerHandler(_handleBehavior);
}

public async global::System.Threading.Tasks.ValueTask<IEnumerable<global::Dummy.User>> HandleAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ partial class GetUsersQuery
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>>
{
private readonly global::Dummy.GetUsersQuery.HandleBehavior _HandleBehavior;
private readonly global::Dummy.GetUsersQuery.HandleBehavior _handleBehavior;
private readonly global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> _loggingBehavior;

public Handler(
global::Dummy.GetUsersQuery.HandleBehavior HandleBehavior,
global::Dummy.GetUsersQuery.HandleBehavior handleBehavior,
global::Dummy.LoggingBehavior<global::Dummy.GetUsersQuery.Query, IEnumerable<global::Dummy.User>> loggingBehavior
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;
_loggingBehavior = loggingBehavior;

_loggingBehavior.SetInnerHandler(_HandleBehavior);
_loggingBehavior.SetInnerHandler(_handleBehavior);
}

public async global::System.Threading.Tasks.ValueTask<IEnumerable<global::Dummy.User>> HandleAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ partial class GetUsersQuery
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<global::Dummy.GetUsersQuery.Query, int>
{
private readonly global::Dummy.GetUsersQuery.HandleBehavior _HandleBehavior;
private readonly global::Dummy.GetUsersQuery.HandleBehavior _handleBehavior;

public Handler(
global::Dummy.GetUsersQuery.HandleBehavior HandleBehavior
global::Dummy.GetUsersQuery.HandleBehavior handleBehavior
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;

}

Expand All @@ -22,7 +22,7 @@ public Handler(
global::System.Threading.CancellationToken cancellationToken = default
)
{
return await _HandleBehavior
return await _handleBehavior
.HandleAsync(request, cancellationToken)
.ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ partial class GetUsersQuery
{
public sealed class Handler : global::Immediate.Handlers.Shared.IHandler<global::Dummy.GetUsersQuery.Query, global::System.ValueTuple>
{
private readonly global::Dummy.GetUsersQuery.HandleBehavior _HandleBehavior;
private readonly global::Dummy.GetUsersQuery.HandleBehavior _handleBehavior;

public Handler(
global::Dummy.GetUsersQuery.HandleBehavior HandleBehavior
global::Dummy.GetUsersQuery.HandleBehavior handleBehavior
)
{
_HandleBehavior = HandleBehavior;
_handleBehavior = handleBehavior;

}

Expand All @@ -22,7 +22,7 @@ public Handler(
global::System.Threading.CancellationToken cancellationToken = default
)
{
return await _HandleBehavior
return await _handleBehavior
.HandleAsync(request, cancellationToken)
.ConfigureAwait(false);
}
Expand Down

0 comments on commit 081da86

Please sign in to comment.