Entity Framework: What is use /Meaning of (?) question mark

c# entity-framework entity-framework-6 linq

Question

I am new to my project, in the project they used Entity Framework & LINQ to manipulate the DB data. Here I am not able to understand why the question mark (?) is used after get() method in the following query. Is it possible to use the (?) mark as like below ?. If yes, then could you please explain in detail.

 uOW.ApplicationDetailsRepository.Get()?
                    .Where (x=>x.Name=="SomeConditions").Tolist();
1
3
5/4/2018 6:17:55 AM

Accepted Answer

When the question mark is used this way (in combination with the period: ?.), it is called the Null-conditional operator. It is a check for null before attempting the rest of the statement.

Here is a reference explaining in detail.

7
5/4/2018 5:43:16 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow