Skip to content

Instantly share code, notes, and snippets.

@explorer14
Created May 27, 2018 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/c093894378d2e7e2d68ea6b1bad3c364 to your computer and use it in GitHub Desktop.
Save explorer14/c093894378d2e7e2d68ea6b1bad3c364 to your computer and use it in GitHub Desktop.
public class Functions
{
private readonly ICreditCheckFilter creditCheckFilter;
private readonly IPipe<EnrichedLoanRequest> pipe;
public Functions(
ICreditCheckFilter creditCheckFilter,
IPipe<EnrichedLoanRequest> pipe)
{
this.creditCheckFilter = creditCheckFilter;
this.pipe = pipe;
}
public async Task ProcessQueueMessage(
[QueueTrigger("submitted-loan-requests")] string loanRequestPayload,
TextWriter log)
{
var submittedLoanRequest = JsonConvert
.DeserializeObject<LoanRequest>(
loanRequestPayload);
var enrichedLoanRequest = await creditCheckFilter
.PerformCreditCheck(submittedLoanRequest);
await pipe.Write(enrichedLoanRequest);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment