2014年11月21日 星期五

C#合併兩個Dictionary

 使用Dictionary類別的擴充方法Concat串接兩個序列

Dictionary<Guid, ViewModel.EventModel> events = roomOpenService.GetRoomOpenEvents(roomListID);
 events = events.Concat(roomBookingService.GetRoomBookingEvents(roomListID)).ToDictionary(k => k.Key, v => v.Value);

Visual Studio JS intellisense 失效解決方式

  試了好久,發現到工具>選項>IntelliCode js項目設定啟用,重新開啟VS就正常了! 後來發現是TypeScript3.2版有問題停用,使用4.3版的TypeScript即可