码迷,mamicode.com
首页 > 其他好文 > 详细

object 类型的传递,传入ServiceKnownType

时间:2017-07-26 12:42:14      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:ram   class   eof   attribute   []   service   att   typeof   upload   

  /// <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

标签:ram   class   eof   attribute   []   service   att   typeof   upload   

原文地址:http://www.cnblogs.com/caiyongxi/p/7238833.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!