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(); |
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
stateVariations = db.StateVariations.ToArray(); | |
// do any filtering on items other than state here, before pulling into memory | |
translations = db.Translations.Filter(…).ToArray(); | |
joinedData = translations.GroupJoin( | |
stateVariations, | |
translation => translation.Id, | |
variation => variation.SystemLanguageTranslationId, | |
(translation, variation) => new { translation, variations = variation }) | |
.Select(x => new CombinedDataObject |
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
Db.Translations.GroupJoin( | |
db.StateVariations, | |
translation => translation.Id, | |
variation => variation.TranslationId, | |
(translation, variation) => new { translation, variations = variation }) | |
.Select(x => new CombinedDataObject | |
{ | |
Id = x.translation.Id, | |
EN = x.translation.EN, | |
Variations = Mapper(x.variations), |
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 score = 40; | |
score /= 2; // score is now 20 |
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 price = 50; | |
price *= 2; // price is now 100 |