白首方悔读书迟 2019-05-19 23:19 采纳率: 100%
浏览 525
已采纳

c# 接口方法返回泛型定义问题

using Sc.Common;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Sc.core.Model.Shop;
using Sc.Service.DtoModel.Shop;

namespace Sc.Service.Interfaces
{
    /// <summary>
    /// 商家分类接口
    /// </summary>
    public interface IShopfl
    {
        #region 商家分类相关操作
        /// <summary>
        /// 获取商家分类列表
        /// </summary>
        /// <param name="shipid">商家的id</param>
        /// <returns></returns>
        Task<ApiResult<Page<sj_flb>>> GetfllbAsync(int shopid);

接口代码如上 这个代码没有问题 ,只是我想定义一个基础接口然后其它接口从基础接口继承 其中有一个问题 就是 Page中的 sj_flb 我想定义 泛型怎么定义啊

Task<ApiResult<Page<T>>> GetfllbAsync(int shopid);
```我这样写不行。
  • 写回答

1条回答 默认 最新

  • threenewbee 2019-05-20 09:26
    关注
    Task<ApiResult<Page<T>>> GetfllbAsync<T>(int shopid);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 虚心请教几个问题,各位DS,小生先有礼了
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题