2017-06-21 37 views
2

我正在使用ServiceStack Fluent驗證,它工作得很好。我確實看到了一個問題。ServiceStack Fluent驗證 - 消息問題

如果我的返回對象名稱是「xxxxStatusResponse」,驗證有效,但我看不到驗證消息。如果返回對象被命名爲「xxxxStatusResult」,我可以看到驗證消息。

我失去了一些東西在這裏?

感謝 rudrvij

回答

2

此行爲是documented in ServiceStacks Error Handling docs。如果您使用的響應DTO ServiceStack的{RequestDtoName}Response命名約定將按順序返回響應DTO的實例,所以它可以用一個結構化的錯誤響應來填充它必須有一個ResponseStatus財產,e.g:

public class MyExampleResponse 
{ 
    public ResponseStatus ResponseStatus { get; set; } 
}