q1:
1. container.RegisterValidators(typeof(UserValidator).Assembly);
// no effect,AddressValidator not injected
2. container.Register<IAddressValidator>(new AddressValidator())
; //this is ok, but no effect?
from “http://docs.servicestack.net/validation” there are two way RegisterValidators, but in my test
http://localhost:49018/api/users?age=-1&format=json will get {"Result":"Hello, !"}
,it is error?
q2:
“ServiceStack\src\ServiceStack\Platforms\PlatformNet.HostConfig.cs” line 157
private static string ExtractHandlerPathFromWebServerConfigurationXml(string rawXml)
{
return XDocument.Parse(rawXml).Root.Element(“handlers”)
.Descendants(“add”)
.Where(handler => EnsureHandlerTypeAttribute(handler).StartsWith(“ServiceStack”))
.Select(handler => handler.Attribute(“path”).Value)
.FirstOrDefault();
}
// this method will throw exceptions when meet below rawXml
<system.webServer>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
</staticContent>
</system.webServer>