This file contains hidden or 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
| let sports: string[] = ['Volleyball', 'Football', 'Basketball', 'Soccer']; |
This file contains hidden or 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
| let notification: NotificationSender; | |
| notification = new EmailSender("Project Update", "[email protected]"); | |
| notification.send(); // Output: Sending email: 'Project Update' to [email protected] | |
| notification = new SMSSender("Meeting at 3 PM", "123456789"); | |
| notification.send(); // Output: Sending SMS: 'Meeting at 3 PM' to 123456789 |
This file contains hidden or 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
| class SMSSender extends NotificationSender { | |
| send(): void { | |
| console.log(`Sending SMS: '${this.message}' to ${this.recipient}`); | |
| } | |
| } | |
| class EmailSender extends NotificationSender { | |
| send(): void { | |
| console.log(`Sending email: '${this.message}' to ${this.recipient}`); | |
| } |
This file contains hidden or 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
| class EmailSender extends NotificationSender { | |
| sendEmail(): void { | |
| console.log(`Sending email: '${this.message}' to ${this.recipient}`); | |
| } | |
| } |
This file contains hidden or 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
| let emailNotification = new NotificationSender("Meeting Reminder", "[email protected]"); | |
| emailNotification.send(); // Output: Sending message: 'Meeting Reminder' to [email protected] |
This file contains hidden or 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
| class NotificationSender { | |
| message: string; | |
| recipient: string; | |
| constructor(message: string, recipient: string) { | |
| this.message = message; | |
| this.recipient = recipient; | |
| } | |
| send(): void { | |
| console.log(`Sending message: '${this.message}' to ${this.recipient}`); |
This file contains hidden or 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
| class NotificationSender { | |
| message: string; | |
| recipient: string; | |
| send(): void { | |
| console.log(`Sending message: '${this.message}' to ${this.recipient}`); | |
| } | |
| } |
This file contains hidden or 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
| <div class="header"> This is a header. </div> |
This file contains hidden or 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
| StringBuilder query = new StringBuilder($";With fullTable as (select b.[Id],[BusinessName], "); | |
| // manipulate data | |
| query.Append($"CAST(CASE WHEN COUNT(service.BusinessId)>0 THEN 1 ELSE 0 END AS bit) as servicesFlag") | |
| query.Append($" from [DB].[Businesses] b "); | |
| // add data to table that is needed for line 2 to execute properly | |
| query.Append($"LEFT JOIN [DB].Services service ON service.BusinessId = b.Id "); | |
This file contains hidden or 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
| StringBuilder query = new StringBuilder($";select * from [DBName].[Businesses] "); | |
| var models = db.Businesses.FromSqlRaw(query.ToString()).ToArray(); |