1
就拿簡單的例子,搜索基於不同的標準一Customer
實體:ServiceStack.net - 搜索路線?
public class Customer : IReturn<CustomerDTO>
{
public int Id { get; set; }
public string LastName { get; set; }
}
public class CustomerDTO
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string ZipCode { get; set; }
}
然後我有以下的路線設置:
public override void Configure(Funq.Container container)
{
Routes
.Add<Customer>("/customers", "GET")
.Add<Customer>("/customers/{Id}", "GET")
.Add<Customer>("/customers/{LastName}", "GET");
}
這似乎並沒有工作。如何定義單獨的路線以在不同的字段上啓用搜索條件?
那麼查詢參數是否區分大小寫?他們必須匹配請求對象上的屬性大小寫? – Sam
@Sam屬性不區分大小寫。 – mythz