我的数据如下表所示
Master Columns
ID MyDateTime
1 07 Sept
2 08 Sept
Run Code Online (Sandbox Code Playgroud)
上面的MyDatetime列具有唯一索引
Detail Columns
ID Data1 Data2 Data3
1 a b c
1 x y z
1 f g h
2 a b c
Run Code Online (Sandbox Code Playgroud)
我想在字典中填充这个.我试过了
Dictionary<DateTime, List<Detail>> result = (
from master in db.master
from details in db.detail
where (master.ID == detail.ID)
select new
{
master.MyDateTime,
details
}).Distinct().ToDictionary(key => key.MyDateTime, value => new List<Detail> { value.details });
Run Code Online (Sandbox Code Playgroud)
我希望字典中有两行
1, List of 3 rows as details
2, List of 1 row …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的应用程序从Delphi 2007升级到Delphi 10 Seattle.我知道记录需要在更改之前复制到本地变量,然后再分配回来.我正在尝试相同但我仍然得到我无法分配给左侧的错误.请有人帮忙.
procedure TMydlg.WMGetMinMaxInfo(var Msg:TMessage);
var
MinMaxInfo: TMinMaxInfo;
begin
inherited;
MinMaxInfo := (PMinMaxInfo(Msg.LParam)^);
with MinMaxInfo do
begin
ptMinTrackSize.X := MinWidth;
ptMinTrackSize.Y := MinHeight;
ptMaxTrackSize.X := MinWidth;
end;
// Error here. Left side cannot be assigned to
(PMinMaxInfo(Msg.LParam)^) := MinMaxInfo;
Run Code Online (Sandbox Code Playgroud)
TMinMaxInfo来自Winapi.windows