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
Rec a = new Rec{myInt = 1, myStr = "test"}; | |
Rec b = a; | |
System.Console.WriteLine(a == b); | |
public record Rec() | |
{ | |
public int myInt; | |
public string myStr; | |
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
function filter<T, K extends keyof T>(obj : T, keys : [K], value: any) : boolean { | |
return keys.some(key => obj[key] === value); | |
} | |
let person = { | |
name: "bos", | |
firstName: "jos" | |
} | |
filter(person, ['firstName', "namee"], "jos"); |
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
// Ordinary | |
public class SimpleDto : ValueObject<SimpleDto> | |
{ | |
public string Value { get; set; } | |
} | |
// With base class | |
public abstract class BaseDto<T> : ValueObject<T> | |
{ | |
public string BaseValue { get; set; } |