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 get an Not Empty Instance back ?
Apr 26 2019 8:42 AM
public static TheQFromDB CalculateMaxVal(List<TheQFromDB> input)
{
TheQFromDB Q = new TheQFromDB();
double maxValue = double.MinValue;
foreach (var item in input)
{
if (item.SecondsDiff > maxValue)
maxValue = item.SecondsDiff;
Q.MaxValue = maxValue;
}
input.Add(Q);
Console.WriteLine(Q.MaxValue);
return Q;
in this Ex here i have a List from Type TheQFromDB and insaid (input) several properties one of them is SecondsDiff .. i want get the class TheQfromDB back but with this code iam getting an Empty instance which call here Q .
Reply
Answers (
1
)
Exception of type 'System.OutOfMemoryException' was thrown
How to find the Max or the Highest value in (List) No LINQ