What does question mark and dot operator ?. mean in C# 6.0?

It’s the null conditional operator. It basically means: “Evaluate the first operand; if that’s null, stop, with a result of null. Otherwise, evaluate the second operand (as a member access of the first operand).” In your example, the point is that if a is null, then a?.PropertyOfA will evaluate to null rather than throwing an exception – it will then compare that null reference with foo (using string’s == overload), … Read more

How can I find a specific element in a List?

Use a lambda expression Note: C# has a built-in syntax for properties. Instead of writing getter and setter as ordinary methods (as you might be used to from Java), write value is a contextual keyword known only in the set accessor. It represents the value assigned to the property. Since this pattern is often used, C# … Read more

LEFT OUTER JOIN in LINQ

How to perform left outer join in C# LINQ to objects without using join-on-equals-into clauses? Is there any way to do that with where clause? Correct problem: For inner join is easy and I have a solution like this but for left outer join I need a solution. Mine is something like this but it’s not working where JoinPair is a … Read more

Access to the path is denied

ou need to find out from the application pool for the website what is the identity it is running under (by default this is Application Pool Identity) and grant that the correct permissions.

Sequence contains no elements?

I’m currently using a single query in two places to get a row from a database. The query is fine when retrieving the row to put data in to the text boxes, but it returns an error “Sequence contains no elements” when used to retrieve the row in order to edit it and put it … Read more