Last active
November 17, 2018 12:48
-
-
Save explorer14/e8bd15f44876310bc8a600e93e762f47 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 Domain | |
{ | |
public class UseCase | |
{ | |
private readonly IAdditionalDataA _serviceA; | |
private readonly IProductService _serviceB; | |
private readonly IAdditionalDataC _serviceC; | |
private readonly IAdditionalDataD _serviceD; | |
private readonly IAdditionalDataE _serviceE; | |
private readonly IAdditionalDataF _serviceF; | |
private readonly IPublisher _publisher; | |
public UseCase( | |
IAdditionalDataA serviceA, | |
IProductService serviceB, | |
IAdditionalDataC serviceC, | |
IAdditionalDataD serviceD, | |
IAdditionalDataE serviceE, | |
IAdditionalDataF serviceF, | |
IPublisher publisher) | |
{ | |
_serviceA = serviceA; | |
_serviceB = serviceB; | |
_serviceC = serviceC; | |
_serviceD = serviceD; | |
_serviceE = serviceE; | |
_serviceF = serviceF; | |
_publisher = publisher; | |
} | |
public async Task Process() | |
{ | |
var dataA = await _serviceA.GetDataA(); | |
var products = await _serviceB.GetProducts(dataA); | |
var dataC = await _serviceC.GetDataC(dataA); | |
var dataD = await _serviceD.GetDataD(dataA); | |
var dataE = await _serviceE.GetDataE(dataA); | |
var dataF = await _serviceF.GetDataF(dataA); | |
foreach (var product in products) | |
{ | |
product.CalculateReorderLevel(dataC, dataD, dataE, dataF); | |
await _publisher.Publish(product); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment