Last active
April 9, 2019 17:08
CalculateManagerFactory
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 CalculateManagerFactory | |
{ | |
private readonly RequestBaseValidator _requestBaseValidator; | |
private readonly RequestBaseSampleDataValidator _sampleDataBaseRequestValidator; | |
private readonly IResponseChainHandler<CalculateInternalRequest, CalculateInternalResponse> _responseChainHandler; | |
public CalculateManagerFactory() | |
{ | |
_requestBaseValidator = new RequestBaseValidator(); | |
_sampleDataBaseRequestValidator = new RequestBaseSampleDataValidator(); | |
_responseChainHandler = new InsuranceResponseChainHandler<CalculateInternalRequest, CalculateInternalResponse>(); | |
// If we want to add more handlers we can do: | |
//_secondResponseChainHandler = new WhatEverHandler<Request, Response>(); | |
//_responseChainHandler.SetNextHandler(nextHandler); | |
} | |
public IRequestManager<CalculateRequest, CalculateResponse> GetCalculateManager( | |
bool returnSampleData, string internalCalculationUri, string internalProductUri, | |
TwoLetterISOLanguageName language = TwoLetterISOLanguageName.da) // default language is da) | |
{ | |
if (returnSampleData) | |
return new CalculateSampleDataManager(new RequestBaseSampleDataValidator()); | |
return new CalculateManager(_requestBaseValidator, internalCalculationUri, | |
internalProductUri, _responseChainHandler, language); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment