基类:public abstract class SolrSearcher : Searcher { protected SolrSearcher(); protected abstract string SolrCoreName { get; } protected virtual QueryOptions BuildQueryOptions(SearchCondition condition); protected abstract Result TransformSolrQueryResult(SolrQueryResults solrQueryResult, SearchCondition condition); }实现类方法: new protected QueryOptions BuildQueryOptions(SearchCondition condition){//此方法硬要说返回值和基类不同,不得已才用了new}protected override WeaponrySearchResult TransformSolrQueryResult(SolrQueryResults solrQueryResult, SearchCondition condition) {//省略掉了}错误 3 “DefenderKingdom.Service.WeaponrySearcher.BuildQueryOptions(DK.Utility.DataAccess.SearchEngine.SearchCondition)”: 返回类型必须是“SolrNet.Commands.Parameters.QueryOptions”才能与重写成员“DK.Utility.DataAccess.SearchEngine.Solr.SolrSearcher.BuildQueryOptions(DK.Utility.DataAccess.SearchEngine.SearchCondition)”匹配 C:\Users\duguk\Desktop\DefenderKingdom\DefenderKingdom.Service\WeaponrySearcher.cs 20 41 DefenderKingdom.Service错误 4 “DefenderKingdom.Service.WeaponrySearcher.TransformSolrQueryResult(SolrNet.SolrQueryResults, DK.Utility.DataAccess.SearchEngine.SearchCondition)”: 没有找到适合的方法来重写 C:\Users\duguk\Desktop\DefenderKingdom\DefenderKingdom.Service\WeaponrySearcher.cs 34 49 DefenderKingdom.Service我简直醉了
3 回答
紫衣仙女
TA贡献1839条经验 获得超15个赞
亲,编译时都给出提示了,返回类型与基类不符啊。
protected QueryOptions BuildQueryOptions(SearchCondition condition)
改成
protected SolrNet.Commands.Parameters.QueryOptions BuildQueryOptions(SearchCondition condition)
- 3 回答
- 0 关注
- 1321 浏览
添加回答
举报
0/150
提交
取消