var list = new List<int> { 3, 1, 0, 5 };
int pos = list.IndexOf(list.Min()); // returns 2
More Related Contents:
- C# custom add in a List
- Group By Multiple Columns
- Distinct not working with LINQ to Objects
- When to use Cast() and Oftype() in Linq
- How to get index using LINQ? [duplicate]
- How do I concatenate two arrays in C#?
- Split a collection into `n` parts with LINQ? [duplicate]
- Why is .Contains slow? Most efficient way to get multiple entities by primary key?
- How should I inject a DbContext instance into an IHostedService?
- Entity Framework/Linq EXpression converting from string to int
- How to flatten nested objects with linq expression
- Difference between Lookup() and Dictionary(Of list())
- How to convert an expression tree to a partial SQL query?
- Apply function to all elements of collection through LINQ [duplicate]
- How to convert linq results to HashSet or HashedSet
- IEqualityComparer for SequenceEqual
- LINQ – Query syntax vs method chains & lambda [closed]
- Resolving extension methods/LINQ ambiguity
- C# Is there a LINQ to HTML, or some other good .Net HTML manipulation API?
- How to consume a Scoped service from a Singleton?
- Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0
- What does this C# code with an “arrow” mean and how is it called?
- Linq Query Group By and Selecting First Items
- What does this C# code with an “arrow” (=>, an equal sign and greater than sign) mean and how is it called?
- What is the purpose of AsQueryable()?
- LINQ query to return a Dictionary
- A dictionary where value is an anonymous type in C#
- Difference between .Net Core, Portable, Standard, Compact, UWP, and PCL?
- How to convert DataTable to class Object?
- How do I compose Linq Expressions? ie Func