我有RequestDTO有另一個DTO在類,它看起來像這樣:ServiceStack - 路線隨着多DTO層
[Route("/TheDtoRequest", "GET")]
[Route("/TheDtoRequest/{do_something_here_to_fill_foobar}", "GET")]
public class TheDtoRequest
{
public string Foo { get; set; }
public int Bar { get; set; }
public FooBar Foobar { get; set; }
}
public class FooBar
{
public string AnotherFoo {get; set;}
public int AnotherBar {get; set;}
}
如何我可以AnotherFoo參數請求?
那麼,這是做技巧!順便說一句,如果我直接使用這樣的:/ TheDtoRequest/{AnotherFoo:HelloWorld,AnotherBar:123}它會拋出你有潛在危險的請求。 – reptildarat
@reptildarat這是一個IIS錯誤,你可以關閉它。我沒有看到,因爲我使用自託管應用程序。應該足夠安全的禁用ServiceStack處理的路由的檢查,因爲它會解析JSV,並且應該罰款任何不良的事情。但很高興它的工作。 – Scott