user2454898
user2454898

Reputation: 13

useing several List<T> as Request in servicestack

When I use several List<T> as request,several List1` appeared on the metadata page. So this is not unique and can not view the operation.

Routes.Add<List<Class1>>("/Class1/BatchSave")
  .Add<List<Class2>>("/Class2/BatchSave")
  .Add<List<Class3>>("/Class3/BatchSave");

But the operation names on the metadata page are all List1`. When I view the operation detail, it's throw an Exception.

Upvotes: 1

Views: 65

Answers (1)

mythz
mythz

Reputation: 143319

You can only register Request DTOs on routes, e.g:

Routes.Add<Class1>("/Class1/BatchSave")
  .Add<Class2>("/Class2/BatchSave")
  .Add<Class3>("/Class3/BatchSave");

Although Request DTOs can inherit collections, e.g:

public class Class1 : List<string> { }

Upvotes: 1

Related Questions