我有以下类:查询字典特定类成员C#
using System;
using System.Collections.Generic;
namespace ddd
{
public class FPSData
{
private double minFPS;
private double maxFPS;
private double averageFPS;
#region Properties
public double MinFPS
{
get { return minFPS; }
set { minFPS = value; }
}
public double MaxFPS
{
get { return maxFPS; }
set { maxFPS = value; }
}
public double AverageFPS
{
get { return averageFPS; }
set { averageFPS = value; }
}
#endregion Properties
public FPSData(double min, double max, double avg)
{
minFPS = min;
maxFPS = max;
averageFPS = avg;
}
}
}
在我的主要功能,我声明了以下内容:
class Program
{
static void Main(string[] args)
{
Dictionary<uint, FPSData> trying = new Dictionary<uint, FPSData>();
FPSData m1 = new FPSData(1, 2, 3);
FPSData m2 = new FPSData(4, 5, 6);
FPSData m3 = new FPSData(7, 8, 9);
trying.Add(101, m1);
trying.Add(102, m2);
trying.Add(103, m3);
Console.WriteLine("sdfgh");
}
}
我试图得到一本字典(Dictionary<uint, doubule>
),比方说,只有最小值。
含义,我的字典将具备以下条件:
101, 1
102, 4
103, 7
我试过的LINQ
许多变化,但只是无法得到它的权利。可能吗?
+1'Console.WriteLine( “sdfgh”);' – RononDex