Last active
January 24, 2021 19:28
-
-
Save babaktaremi/f561528ebc17253afc303b85c9816332 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
namespace MediatRExploration.Application.Common | |
{ | |
public class CommitPostProcessor<TRequest, TResponse> : IRequestPostProcessor<TRequest, TResponse> | |
{ | |
private readonly ILogger<RequestPostProcessor<TRequest, TResponse>> _logger; | |
public CommitPostProcessor(ILogger<RequestPostProcessor<TRequest, TResponse>> logger) | |
{ | |
_logger = logger; | |
} | |
public async Task Process(TRequest request, TResponse response, CancellationToken cancellationToken) | |
{ | |
if (request is ICommitable) | |
{ | |
//TODO Save Changes to database...DbContext.SaveChanges() | |
_logger.LogWarning("Saving Changes to the database"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment