よりクリーンな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;}
...
}