我有一個HorseController其指數的方法,如:如何在MVC網站中使用屬性路由來翻譯查詢參數?
[GET("Index", TranslationKey = "HorseIndex")]
[AllowAnonymous]
public ActionResult Index(int? page, HorseTypes? type, HorseGenders? gender, HorseBreeds? breed, HorseJumps? jump,
HorseDressages? dressage, String maxAge, String priceFrom, String priceTo, Country? country, bool? hasPicture, bool? hasVideo)
{
...
}
我翻譯這樣的路線:
provider.AddTranslations()
.ForKey("HorseIndex", new Dictionary<string, string>
{
{ "da", "heste-til-salg" },
{ "en", "horses-for-sale" }
})
的問題是,現在,對於丹麥用戶的網址是:
http://localhost:12623/heste-til-salg?page=1&hasPicture=False&hasVideo=False
我的問題是如何翻譯查詢參數嗎?我不能在documentation中找到它。