-
-
Save dcomartin/0d70c9484cbd35c6839d797a81d2b195 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 static class Extensions | |
{ | |
public static bool IsDownloadable(this OfferingType offeringType) | |
{ | |
var validOfferings = new List<OfferingType>() | |
{ | |
OfferingType.Template, | |
OfferingType.Ebook, | |
OfferingType.OfflineCourse | |
}; | |
return validOfferings.Contains(offeringType); | |
} | |
} | |
public sealed class ProductHandler(ResourcesHelper resourcesHelper) | |
{ | |
public void DoStuff(Product product) | |
{ | |
if (product.Type.IsDownloadable()) | |
{ | |
var fileName = resourcesHelper.GetDefaultDownloadFileName(product.Type); | |
var downloadUrl = resourcesHelper.GetDownloadUrl(product.Type); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment