I have the following call, which works as supposed to.
[HttpGet("translation")]
public ActionResult Translations(string id)
{
CultureInfo culture = new CultureInfo(id);
return Translation
.GetTranslationByCulture(culture);
}
I wanted to try passing a full cultural info object to avoid the conversion in the API, like this.
[HttpGet("translation2")]
public ActionResult Translations2(CultureInfo culture)
{
return Translation
.GetTranslationByCulture(culture);
}
It kind of works but I'm not sure what string passed from Angular (or in Swagger, for that matter), that would be a proper serialization of the CultureInfo
instance. I tried backward enginering it by returning an instance from my API but got an error 500 due to exceeded limit of circular references in the returned object (as the JSON serialization supports depth of 32 at best).
What do I send in to the parsed as an instance of a culture?