Last active
May 30, 2018 06:45
-
-
Save jonasdw/9dd80ff00d59d6f371a2adcfc72a1118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExtendCommandWithData<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> | |
{ | |
public async Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next) | |
{ | |
// do something with request to add the data | |
//if (typeof(TRequest).IsAssignableFrom(typeof(ICommand))) | |
//{ | |
// request.AddUserId("id"); | |
//} | |
var response = await next(); | |
return response; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ICommand | |
{ | |
string UserId { get; set; } | |
string UserIpAdress { get; set; } | |
} |
hagbarddenstore
commented
May 30, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment