mateusz-klosinski
snippet-background
public interface ILogger
{
void LogMessage(string message);
void LogWarning(string warning)
{
Console.WriteLine($"[DEFAULT] WARNING: {warning}");
}
}
🚀 Boost C# interfaces! Add new methods, no breaking changes!
Traditional interface methods must be implemented by classes.
C# 8+ allows default implementations directly in interfaces.
qtd-logo-watermark
mateusz-klosinski
snippet-background
// Generate numbers from 1 to 5
var sequence1 = Enumerable.Range(1, 5);

// Generate numbers from 10 to 12 (inclusive)
var sequence2 = Enumerable.Range(10, 3);

// You can also use it directly in a loop
foreach (int i in Enumerable.Range(0, 3))
{
Console.Write(i + " ");
}
✨ C#: Ditch manual foreach loops!
Master sequence generation with Range()
qtd-logo-watermark