1

よりクリーンなPOCO設計なので、以下のようなものを設定したいのですが、遅延ロードされたPOCOUserIdの代わりにのプロパティを作成することによってのみ、これを機能させることができるようです。int

[Route("/Accounts", "GET")]  //Where I want to be able to do /Accounts?UserId=1234 
[Route("/Accounts/{Id}", "GET")] 
public class Account
{
  public User User {get;set;}
  public int Id {get;set;}
  ...
}

public class User
{
  public int Id {get;set;}
  ...Lazily loaded values
}

これが唯一のオプションですか?

public class Account
{
  public int UserId {get;set;}
  public int Id {get;set;}
  ...
}
4

1 に答える 1

-1

Account クラスはあなたのリクエスト dto ですか? リクエスト dto をルートで装飾する方法については、wiki を参照してください ( https://github.com/ServiceStack/ServiceStack/wiki/Routing )。

于 2013-08-31T12:58:07.467 に答える