我有一个使用AppSelfHostBase
的ServiceStack自托管the服务。
WHen方法被执行,我有这样的配置:
public override void Configure(Container container)
{
Config.RouteNamingConventions = new List<RouteNamingConventionDelegate> {
RouteNamingConvention.WithRequestDtoName,
RouteNamingConvention.WithMatchingAttributes,
RouteNamingConvention.WithMatchingPropertyNames,
};
Routes.AddFromAssembly(typeof(ServiceStackHost).Assembly);
我希望下面的服务在/StartBankIdAuthentication
路径下执行,但它却驻留在/json/reply/StartBankIdAuthentication
下。
public class StartBankIdAuthentication : IReturn<StartBankIdAuthenticationResponse>
{
public string IdNbr { get; set; }
}
另外,有没有一种自动的方法使DTO中的属性位于“子路径”下,如/StartBankIdAuthentication/1234
而不是/StartBankIdAuthentication?IdNbr=1234
我知道我可以手动添加Route
属性,但它看起来很麻烦,而且在许多方面也很混乱(不键入,容易出错等)。
https://stackoverflow.com/questions/52341689
复制相似问题