... | ... | @@ -20,144 +20,144 @@ FirstOrDefault(), SingleOrDefault(), Where(), Select() |
|
|
|
|
|
* 아래 코드를 분석해주세요.
|
|
|
|
|
|
'
|
|
|
```
|
|
|
// 멤버 변수
|
|
|
public ObservableCollection<PmPowerItem> TxPowerItems
|
|
|
|
|
|
void LinqTestCode()
|
|
|
{
|
|
|
// 이 부분은
|
|
|
void LinqTestCode()
|
|
|
{
|
|
|
// 이 부분은
|
|
|
// TxPowerItems 컬렉션을 채우는 코드
|
|
|
// TxPowerItems.Add(pmItem);
|
|
|
|
|
|
// 아래 LINQ 코드를 분석해 보세요
|
|
|
// groupTemp 변수는 어떤 형태의 값이 채워지나요?
|
|
|
|
|
|
|
|
|
var groupTemp = from data in TxPowerItems
|
|
|
group data by data.Path into newData
|
|
|
orderby newData.Key
|
|
|
select new
|
|
|
{
|
|
|
Key = newData.Key,
|
|
|
Temps = newData.ToList()
|
|
|
};
|
|
|
}
|
|
|
|
|
|
|
|
|
group data by data.Path into newData
|
|
|
orderby newData.Key
|
|
|
select new
|
|
|
{
|
|
|
Key = newData.Key,
|
|
|
Temps = newData.ToList()
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// PmPowerItem은 아래와 같이 단순한 ValueObject 입니다.
|
|
|
public class PmPowerItem : ViewModelBase
|
|
|
{
|
|
|
private int _number;
|
|
|
private string _type;
|
|
|
private string _probeId;
|
|
|
private string _path;
|
|
|
private string _hostIp; // DU IP
|
|
|
private string _tid; // 메모
|
|
|
public class PmPowerItem : ViewModelBase
|
|
|
{
|
|
|
private int _number;
|
|
|
private string _type;
|
|
|
private string _probeId;
|
|
|
private string _path;
|
|
|
private string _hostIp; // DU IP
|
|
|
private string _tid; // 메모
|
|
|
private string _aid;
|
|
|
private string _rxMin;
|
|
|
private string _rxMax;
|
|
|
private string _rxAvg;
|
|
|
private string _txMin;
|
|
|
private string _txMax;
|
|
|
private string _txAvg;
|
|
|
private string _time;
|
|
|
private DateTime _dateTime;
|
|
|
|
|
|
public int Number
|
|
|
{
|
|
|
get { return _number; }
|
|
|
set { _number = value; OnPropertyChanged("Number"); }
|
|
|
}
|
|
|
|
|
|
public string Type
|
|
|
{
|
|
|
get { return _type; }
|
|
|
set { _type = value; OnPropertyChanged("Type"); }
|
|
|
}
|
|
|
|
|
|
public string ProbeId
|
|
|
{
|
|
|
get { return _probeId; }
|
|
|
set { _probeId = value; OnPropertyChanged("ProbeId"); }
|
|
|
}
|
|
|
|
|
|
public string Path
|
|
|
{
|
|
|
get { return _path; }
|
|
|
set { _path = value; OnPropertyChanged("Path"); }
|
|
|
}
|
|
|
|
|
|
public string HostIP // DU IP
|
|
|
{
|
|
|
get { return _hostIp; }
|
|
|
set { _hostIp = value; OnPropertyChanged("HostIP"); }
|
|
|
}
|
|
|
|
|
|
public string TID // 메모
|
|
|
private string _rxMin;
|
|
|
private string _rxMax;
|
|
|
private string _rxAvg;
|
|
|
private string _txMin;
|
|
|
private string _txMax;
|
|
|
private string _txAvg;
|
|
|
private string _time;
|
|
|
private DateTime _dateTime;
|
|
|
|
|
|
public int Number
|
|
|
{
|
|
|
get { return _number; }
|
|
|
set { _number = value; OnPropertyChanged("Number"); }
|
|
|
}
|
|
|
|
|
|
public string Type
|
|
|
{
|
|
|
get { return _type; }
|
|
|
set { _type = value; OnPropertyChanged("Type"); }
|
|
|
}
|
|
|
|
|
|
public string ProbeId
|
|
|
{
|
|
|
get { return _probeId; }
|
|
|
set { _probeId = value; OnPropertyChanged("ProbeId"); }
|
|
|
}
|
|
|
|
|
|
public string Path
|
|
|
{
|
|
|
get { return _path; }
|
|
|
set { _path = value; OnPropertyChanged("Path"); }
|
|
|
}
|
|
|
|
|
|
public string HostIP // DU IP
|
|
|
{
|
|
|
get { return _hostIp; }
|
|
|
set { _hostIp = value; OnPropertyChanged("HostIP"); }
|
|
|
}
|
|
|
|
|
|
public string TID // 메모
|
|
|
{
|
|
|
get { return _tid; }
|
|
|
set { _tid = value; OnPropertyChanged("TID"); }
|
|
|
}
|
|
|
|
|
|
public string AID
|
|
|
{
|
|
|
get { return _aid; }
|
|
|
set { _aid = value; OnPropertyChanged("AID"); }
|
|
|
}
|
|
|
|
|
|
public string RxMin
|
|
|
{
|
|
|
get { return _rxMin; }
|
|
|
set { _rxMin = value; OnPropertyChanged("RxMin"); }
|
|
|
}
|
|
|
|
|
|
public string RxMax
|
|
|
{
|
|
|
get { return _rxMax; }
|
|
|
set { _rxMax = value; OnPropertyChanged("RxMax"); }
|
|
|
}
|
|
|
|
|
|
public string RxAvg
|
|
|
{
|
|
|
get { return _rxAvg; }
|
|
|
set { _rxAvg = value; OnPropertyChanged("RxAvg"); }
|
|
|
}
|
|
|
|
|
|
public string TxMin
|
|
|
{
|
|
|
get { return _txMin; }
|
|
|
set { _txMin = value; OnPropertyChanged("TxMin"); }
|
|
|
}
|
|
|
|
|
|
public string TxMax
|
|
|
{
|
|
|
get { return _txMax; }
|
|
|
set { _txMax = value; OnPropertyChanged("TxMax"); }
|
|
|
}
|
|
|
|
|
|
public string TxAvg
|
|
|
{
|
|
|
get { return _txAvg; }
|
|
|
set { _txAvg = value; OnPropertyChanged("TxAvg"); }
|
|
|
}
|
|
|
|
|
|
public string Time
|
|
|
{
|
|
|
get { return _time; }
|
|
|
set { _time = value; OnPropertyChanged("Time"); }
|
|
|
}
|
|
|
|
|
|
public DateTime DateTime
|
|
|
{
|
|
|
get { return _tid; }
|
|
|
set { _tid = value; OnPropertyChanged("TID"); }
|
|
|
}
|
|
|
|
|
|
public string AID
|
|
|
{
|
|
|
get { return _aid; }
|
|
|
set { _aid = value; OnPropertyChanged("AID"); }
|
|
|
}
|
|
|
|
|
|
public string RxMin
|
|
|
{
|
|
|
get { return _rxMin; }
|
|
|
set { _rxMin = value; OnPropertyChanged("RxMin"); }
|
|
|
}
|
|
|
|
|
|
public string RxMax
|
|
|
{
|
|
|
get { return _rxMax; }
|
|
|
set { _rxMax = value; OnPropertyChanged("RxMax"); }
|
|
|
}
|
|
|
|
|
|
public string RxAvg
|
|
|
{
|
|
|
get { return _rxAvg; }
|
|
|
set { _rxAvg = value; OnPropertyChanged("RxAvg"); }
|
|
|
}
|
|
|
|
|
|
public string TxMin
|
|
|
{
|
|
|
get { return _txMin; }
|
|
|
set { _txMin = value; OnPropertyChanged("TxMin"); }
|
|
|
}
|
|
|
|
|
|
public string TxMax
|
|
|
{
|
|
|
get { return _txMax; }
|
|
|
set { _txMax = value; OnPropertyChanged("TxMax"); }
|
|
|
}
|
|
|
|
|
|
public string TxAvg
|
|
|
{
|
|
|
get { return _txAvg; }
|
|
|
set { _txAvg = value; OnPropertyChanged("TxAvg"); }
|
|
|
}
|
|
|
|
|
|
public string Time
|
|
|
{
|
|
|
get { return _time; }
|
|
|
set { _time = value; OnPropertyChanged("Time"); }
|
|
|
}
|
|
|
|
|
|
public DateTime DateTime
|
|
|
{
|
|
|
get { return _dateTime; }
|
|
|
set { _dateTime = value; OnPropertyChanged("DateTime"); }
|
|
|
}
|
|
|
|
|
|
public double? TxMinValue { get; set; }
|
|
|
public double? TxMaxValue { get; set; }
|
|
|
public double? TxAvgValue { get; set; }
|
|
|
public double? RxMinValue { get; set; }
|
|
|
public double? RxMaxValue { get; set; }
|
|
|
public double? RxAvgValue { get; set; }
|
|
|
}
|
|
|
' |
|
|
\ No newline at end of file |
|
|
get { return _dateTime; }
|
|
|
set { _dateTime = value; OnPropertyChanged("DateTime"); }
|
|
|
}
|
|
|
|
|
|
public double? TxMinValue { get; set; }
|
|
|
public double? TxMaxValue { get; set; }
|
|
|
public double? TxAvgValue { get; set; }
|
|
|
public double? RxMinValue { get; set; }
|
|
|
public double? RxMaxValue { get; set; }
|
|
|
public double? RxAvgValue { get; set; }
|
|
|
}
|
|
|
|
|
|
``` |
|
|
\ No newline at end of file |