Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace Domain
{
public class UseCase
{
private readonly IPublisher _publisher;
private readonly IRetrieveProducts _productsRetriever;
public UseCase(
IPublisher publisher,
IRetrieveProducts productsRetriever)
{
_publisher = publisher;
_productsRetriever = productsRetriever;
}
public async Task Run()
{
var products = await _productsRetriever.Get();
foreach (var product in products)
{
product.CalculateReorderLevel();
await _publisher.Publish(product);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.