score:10
Accepted answer
This won't change the ordering of the original list, but will sort the resulting enumeration of the list and select the first point after the ordering. It handles the empty list case by returning a default (null) Point.
var firstPoint = Points.OrderBy( p => p.X ).ThenBy( p => p.Y ).FirstOrDefault();
score:5
var firstPoint = (from p in Points orderby p.X, p.Y select p).FirstOrDefault();
Source: stackoverflow.com
Related Query
- Using Linq find first object in list sorting by property A, then property B
- Return list of specific property of object using linq
- Find first element of certain type in a list using LINQ
- How to fill a property of an object from another list using LINQ
- I am trying create a new list of users from a list of users who have not created an additional object with a certain property using LINQ
- How to find how many times the same object appears in a list and then find a property of the most appeared object
- Using LINQ to get the difference between two list of objects based only on a single object property
- LINQ query using list of objects property of an object
- Is a full list returned first and then filtered when using linq to sql to filter data from a database or just the filtered list?
- Get minimum and maximum time value from list of object property using Linq
- Get distinct or groupby list using linq of object property
- Find an Object that contains a string in a list of strings using LINQ
- Find object in list with given property value then find dictionary value
- LINQ sorting of property List in List of custom object
- sorting list of objects by 2 property of that objects using linq
- Filter list of entity objects by string child object property using Linq Lambda
- Casting substrings with linq into a list of object and than sorting it base on property in vb.net
- Find a string in the list and change value of another property using linq (complicated)
- How can I find the first items in a list with a different value for a property using Linq?
- Sort list of lists using LINQ so high score is first then lastname and firstname in alphabetic order
- Comparing a list of values against the property of an object (list) using LINQ
- Getting InvalidCastException when trying to implement sorting in Entity Framework Code First using Linq
- Group objects in List by property in object that is List using LINQ
- Using LINQ to Update A Property in a List of Entities
- How to get first object out from List<Object> using Linq
- Get index of object in a list using Linq
- Selecting first 10 records, then next 10, paging using Linq
- How to handle NULL object property with FirstOrDefault using Linq
- Using LINQ to find item in a List but get "Value cannot be null. Parameter name: source"
- Create a list of one object type from a list of another using Linq
More Query from same tag
- LINQ Distinct from 3 tables (many to many relationship)
- Linq nested group by to manipulate identity data
- Updating two fields of an observable collection item at once using Linq
- Issue with getting a special attribute in XPath
- Entity Framework Code First ToList method timing out on SQL Azure
- How to use LinqToExcel to get cell values without header
- How can I call a local function inside a LINQ query?
- Populate DataTable with nested dictionary result
- LINQ find average from CSV objects
- Replacing nested foreach with LINQ; modify and update a property deep within
- Conditioning LINQ Query
- How can I get running totals of integer values from a List()?
- KeyValuePair from running Raw SQL query on Entity Framework
- Linq Select list of dynamic properties into another Object?
- How to use async lambda with SelectMany?
- lock a database or a set of tables from C# Linq 4.0?
- How can I return a custom class from a web service?
- EF LINQ select entities where Id is in List
- How to find column value by comparing another column value in LINQ where case does not any matter
- LEFT OUTER JOIN 2 datatables
- How to properly search xml document using LINQ C#
- C# - Using a Predicate to select a property
- LINQ query return
- multiple condition in entity framework
- Get AutoGenerated Id from SQL Server using LINQ
- My LINQ query is not ordering my dictionary
- How to perform linq search with spaces
- How to fix "LINQ to Entities does not recognize the method 'System.DateTime GetValueOrDefault()'"?
- LINQ group by for count
- Convert String To Int in LINQ