一、
反組譯出來的程式碼中,如果出現 CallSite ,這個應該是程式碼裡面用了dynamic,這次的例子中有出現這個
public static CallSite
, OHLCDto, object>> <>p__0;但我還不知道這些型態是怎麼決定的 … 先記一下
二、
程式碼中出現<>這種東西,大概就是編譯的時候編出來的,很有可能是delegate、()=>或是Lambda表示式
三、Function 上有[AsyncStateMachine(typeof(OHLCPublisher.
[DebuggerStepThrough, AsyncStateMachine(typeof(OHLCPublisher.d__6))]
public Task Publish(OHLCDto ohlc)
{
OHLCPublisher.d__6 d__ = new OHLCPublisher.d__6();
d__.<>4__this = this;
d__.ohlc = ohlc;
d__.<>t__builder = AsyncTaskMethodBuilder.Create();
d__.<>1__state = -1;
AsyncTaskMethodBuilder <>t__builder = d__.<>t__builder;
<>t__builder.Startd__6>(ref d__);
return d__.<>t__builder.Task;
}
上面這段整理過後是
public async Task Publish(OHLCDto ohlc)
{
await Task.FromResult(
(dynamic)new
{
Publisher = this,
ohlc = ohlc,
builder = AsyncTaskMethodBuilder.Create(),
state = -1
});
}
沒有留言:
張貼留言