object 类型的传递,传入ServiceKnownType

Posted 布雷客·希

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了object 类型的传递,传入ServiceKnownType相关的知识,希望对你有一定的参考价值。

  /// <summary>
    /// 获取所有的类型
    /// </summary>
    public static class TypeHelper
    {
        public static IEnumerable<Type> GetKnownTypes(ICustomAttributeProvider provider)
        {
            return new[] { typeof(PKGRecord), typeof(List<PKGRecord>), typeof(UploadParam) };
        }
    }

  在服务接口中定义 [ServiceKnownType("GetKnownTypes", typeof(TypeHelper))] 标签

以上是关于object 类型的传递,传入ServiceKnownType的主要内容,如果未能解决你的问题,请参考以下文章