Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# void with nullable List argument

public void Process(string param1, List<string> param2 = null) 
{
    param2 = param2 ?? new List<string>();

    // or starting with C# 8
    param2 ??= new List<string>();
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: check which activity in focus in android 
Csharp :: asp.net disabled checkbox style 
Csharp :: quine in c# 
Csharp :: CefSharp.Core in clickones application 
Csharp :: c sharp tenery operator on an action 
Csharp :: how to set the forgound color of listitems in c# 
Csharp :: asp.net mvc select from many to many relationship 
Csharp :: xamarin forms uwp button hover 
Csharp :: set field in list linq 
Csharp :: unitydont play sound until finsihed 
Csharp :: BindableDynamicDictionary 
Csharp :: c# convert linq jValue to int 
Csharp :: How to add a dynamically created form to a new tab in Syncfusion WinForms TabControlAdv? 
Csharp :: c# open explorer and select file 
Csharp :: how to initialize array in c# 
Csharp :: what loops are entry controlled c# 
Csharp :: Jeng InitDb 
Csharp :: design pattern for so many conditions c# 
Csharp :: unity oculus vibrate 
Csharp :: Implementing Banner Ads Unity 
Csharp :: unity manager.instance 
Csharp :: detect mouse in bottom of screen + unity 
Csharp :: can a dictionary type use get set c# 
Csharp :: matric multiplication 
Csharp :: c# linq aggregate string builder 
Csharp :: create entity c# d365 
Csharp :: unity timer 
Csharp :: sort number in dynamo 
Csharp :: c# read only file used by other app 
Csharp :: download file c# 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =