using Optional; namespace OO; public enum OfferingType { Course, Ebook, Book, Template, OfflineCourse, } public class Product(int id, OfferingType type) { public virtual Option<string> GetDownloadUrl() { return Option.None<string>(); } public virtual Option<string> GetDefaultDownloadFileName() { return Option.None<string>(); } } public class DownloadProduct(int id, OfferingType type) : Product(id, type) { public override Option<string> GetDefaultDownloadFileName() { return Option.Some("Some Value"); } public override Option<string> GetDownloadUrl() { return Option.Some("Some Value"); } } public sealed class ProductHandler() { public void DoStuff(Product product) { var fileName = product.GetDefaultDownloadFileName(); var downloadUrl = product.GetDownloadUrl(); } }