首页 > 其他 > 详细

Orchard 事件通知小坑

时间:2015-10-14 06:53:39      阅读:120      评论:0      收藏:0      [点我收藏+]
public void GetTagLogRecord(int tagId, string keyword, string area) {
            var tag = _repositoryTagRecord.Get(tagId);
            OnlineGet(tag, keyword, area);
        }

  

_jobsQueueService.Enqueue("IClawerService.GetTagLogRecord", new Dictionary<string, object> {
                                { "tagId", tag.Id }
                                , { "keyword", tag.Keyword }
                                , { "area", area }
                            }, 1);

 

if (cachedDelegate != null) {
                var args = cachedDelegate.Item1.Select(methodParameter => arguments[methodParameter.Name]).ToArray();
    //此处args为object[]数组,调用下面的一句话始终报转换无效的错误,
//调试时将args手动构造成 args = new object[] { 23, "PPAPI", "" };又没问题 !!!!!!
//不知道是不是.NET的bug !!!
                var result = cachedDelegate.Item2(eventHandler, args);

                returnValue = result as IEnumerable;
                if (result != null && (returnValue == null || result is string))
                    returnValue = new[] { result };
                return true;
            }    

  

否则  cachedDelegate.Item2  始终报错 :  指定的转换无效 !!!!!

Orchard 事件通知小坑

原文:http://www.cnblogs.com/cabbage/p/4876318.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!