5
我装饰的动作如下对象不是原始用于响应消息模型
[SwaggerResponse(HttpStatusCode.OK, "List of customers", typeof(List<CustomerDto>))]
[SwaggerResponse(HttpStatusCode.NotFound, Type = typeof(NotFoundException))]
该行模型显示正确。
但是,在Repsonse消息下,我得到'对象不是原始'NotFound
。自定义异常从Exception
派生,实现ISerializable
,也有[Serializable]
和[DataContract()]
我怎么能显示实际数据类型的信息呢?
另外,如果我使用这些属性来装饰所有动作,我是否会在正常使用WebApi时发生性能下降?