Adding with Kristin's answer, There is no difference in performance because after compile they generate same IL code for the same query. Language Integrated Query (LINQ) is feature of Visual Studio that gives you the capabilities yo query on the language syntax of C#, so you will get SQL kind of queries. And Lambda expression is an anonymous function and is more of a like delegate type. All lambda expressions use the lambda operator =>, which is read as "goes to". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. Personally I like Lambda Expression. Hope this helps you.
Chaar:
XMLSerializer class when used together with a Text Writer allows you to store C# structure to XML file but we lose the top element of the generic array collection.
To avoid this, serialization can be improved by using XmlRoot attribute. Example:
List<Person> personList = FormTouristList();
XmlSerializer xmlSerializer = new XmlSerializer(List<Person>);
[XmlRoot("PersonList")] can be used while serializing to avoid losing the top element.
No comments:
Post a Comment