That’s by the way also true for IEnumerable itself. This interface provides only the basic functionality for working with collections (really, just iterating through them), and so if your method requires more than that, also state that requirement up front. For example, if the only thing you need out of a collection is the capability to enumerate its elements, it’s fine to use IEnumerable:
public void SomeMethod(IEnumerable<string> collection) { foreach (string element in collection)
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ | |
{ | |
"type": "shell", | |
"style": "plain", |
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
# Handle PowerShell 7.4+ UTF-8 encoding issues | |
$previousOutputEncoding = [Console]::OutputEncoding | |
[Console]::OutputEncoding = [Text.Encoding]::UTF8 | |
try { | |
# # PowerToys Command Not Found Integration (with safe handling) | |
# $powerToysModulePath = Join-Path $env:LocalAppData "PowerToys\WinGetCommandNotFound.psd1" | |
# if (Test-Path $powerToysModulePath) { | |
# try { | |
# # Enable PowerShell Experimental Features for PowerToys |
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
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
if ($host.Name -eq 'ConsoleHost') | |
{ | |
Import-Module PSReadLine | |
} | |
#Import-Module PSColors | |
#Import-Module posh-git | |
Import-Module -Name Terminal-Icons |
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
using System.Net; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc.Testing; | |
using Snapshooter.Json; | |
using Xunit; | |
namespace MyCompany.MyService | |
{ | |
public class GraphQLSchemaTests | |
: IClassFixture<WebApplicationFactory<Startup>> |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Text.Json; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Newtonsoft.Json; |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"copyOnSelect": false, | |
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", | |
// Add custom keybindings to this array. | |
// To unbind a key combination from your defaults.json, set the command to "unbound". | |
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings | |
"keybindings": | |
[ | |
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. |
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[string] | |
$RiderHome | |
) | |
function Update-WindowsDefenderForRider { | |
[CmdletBinding()] | |
param ( |
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
# Taps | |
tap 'homebrew/cask-fonts' | |
tap 'homebrew/cask-versions' | |
tap 'heroku/brew' | |
# Install CLI Tools | |
## Shell Utilities | |
brew 'coreutils' | |
brew 'findutils' | |
brew 'autojump' |
based on original document from Alan Stevens
- Install using Local Account first, attach Microsoft account later
NewerOlder