http://www.ilkon.com

have a simple case where I wan to do this shorter

if (customerSource.Name!= null)
{
destinationCustomer._NAME == customerSource.Name;
}
else
{
destinationCustomer.Name = " ";
}


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

why can't I do this Like this

destinationCustomer = !! customerSource.Name : " ";

*!! will check the condition is null or not, if not nul nul than it assigns customer.Name,if null than it assigns " "

is there a syntax I am missing



Re: Visual C# General isNull check and c# operators confusion

Ken Tucker

Code Snippet
destinationCustomer.Name =(customerSource.Name!= null) customerSource.Name : " ";


http://msdn2.microsoft.com/en-us/library/ty67wk28(VS.80).aspx






Re: Visual C# General isNull check and c# operators confusion

www.ilkon.com

sorry my bad......

but like the parantesis.....





Re: Visual C# General isNull check and c# operators confusion

Thomas Danecker

Code Snippet
destinationCustomer.Name = customerSource.Name " ";

http://msdn2.microsoft.com/en-us/library/ms173224.aspx