public string SayHello() { //var vendor = new Vendor(); //vendor.SendWelcomeEmail("Message from product"); var emailService = new EmailService(); var confirmation = emailService.SendMessage("New Product", this.productName, "*****@*****.**"); var result = LogAction("saying hello"); return("Hello " + ProductName + " (" + ProductId + "): " + Description + " Available on: " + //If not null, use datestring AvailabilityDate?.ToShortDateString()); }
public string SayHello() { // can call because the vendor class is in the same namespace // as this class // instatiating the vendor only needed in the class within this method //var vendor = new Vendor(); //vendor.SendWelcomeEmail("Message from product"); var emailService = new EmailService(); var confirmation = emailService.SendMessage("Subject", this.ProductName, "*****@*****.**"); // using static feature to call static method var result = LogAction("saying hello method in Product"); return("Hello " + ProductName + " (" + ProductId + "): " + Description + " Available on: " + AvailabilityDate?.ToShortDateString()); }
public string SayHello() { //var vendor = new Vendor(); //vendor.SendWelcomeEmail("Message from Product"); return("Hello " + ProductName + " (" + ProductId + "): " + Description + " " + ProductVendor.CompanyName + " Available on: " + AvailabilityDate?.ToShortDateString()); }