-
-
Save dcomartin/323f296b774d2a364ed98e321e0925ff 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
public sealed record DownloadableResource( | |
int Id, | |
int ProductId, | |
string DownloadUrl, | |
string DefaultDownloadFilename); | |
public sealed class ProductHandler2(ResourcesHelper2 _resourcesHelper) | |
{ | |
public void DoStuff(Product product) | |
{ | |
var downloadableResource = _resourcesHelper.GetDownloadable(product.Id); | |
// do stuff with downloadable resource | |
} | |
} | |
public sealed class ResourcesHelper2 | |
{ | |
public DownloadableResource? GetDownloadable(int productId) | |
{ | |
// TODO: go fetch this from the DB or return null... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment