Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# if with obj params

object obj = new Person
{
    FirstName = "Kathleen",
    LastName = "Dollard",
    Address = new Address { City = "Seattle" }
};

if (obj is Person { Address: { City: "Seattle" } })
    Console.WriteLine("Seattle");

if (obj is Person { Address.City: "Seattle" }) // Extended property pattern
    Console.WriteLine("Seattle");
Comment

PREVIOUS NEXT
Code Example
Csharp :: worsening 
Csharp :: asp.net mvc class="" inline select 
Csharp :: C# read GroupComponent using regex 
Csharp :: C# pull appart property chain in expression 
Csharp :: delay seconds in unity 
Csharp :: mesh data optimization resolving used channels 
Csharp :: binaural generator 
Csharp :: C# Move Camera Over Terrain Using Touch Input In Unity 3D - Append To Camera 
Csharp :: c# 2 timespan return yesterday 
Csharp :: Cursor Button Lock and Area limitation 
Csharp :: trimend c# 
Csharp :: temp^late php table for mysql 
Csharp :: CharacterController 
Csharp :: c# directory entry invoke 
Csharp :: c# Windows Forms screenshot 
Csharp :: you have the following c# code. stringbuilder sb = new stringbuilder(really long string); the really long string variable is a string in which a very long string is stored. 
Csharp :: split a datatable based on number of rows 
Csharp :: PUN 2 Network Transform View Jittery Movement 
Csharp :: how to input data several times in c# 
Csharp :: c# convert 1 to 01 
Csharp :: how to run a console app in another app c# 
Csharp :: membership get user id 
Csharp :: If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. 
Csharp :: why icollection is use with virtual keyword in c# 
Csharp :: how to mock abstract httpcontext using moq .net core 
Csharp :: Get mac address of Device - NAYCode.com 
Csharp :: Open Windows Explorer to a certain directory from within a WPF app 
Csharp :: C# free text search 
Csharp :: nunit return parameter 
Csharp :: attributes C# reflection variable update site:stackoverflow.com 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =