TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdalla Omran
NA
334
32k
How to find the Max or the Highest value in (List) No LINQ
Apr 26 2019 3:29 PM
In this Method returns the TheQFromDB an Instance from the input list where the property SecondsDiff is the highest and in each item in input has a SecondDiff value but one is the highest . how could i find that without using LINQ ? and how could i check all the items . Look at the Code please
public static TheQFromDB CalculateMaxVal (List<TheQFromDB> input)
{
double maxValue = double.MinValue;
foreach (var item in input)
{
if (item.SecondsDiff > maxValue)
{
maxValue = item.SecondsDiff;
}
}
Console.WriteLine(maxValue);
return null;
}
Reply
Answers (
5
)
How to get an Not Empty Instance back ?
When we should use IN keyword in C#?