Customer
以基于不同条件搜索实体的简单示例为例:
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");
}
这似乎不起作用。如何定义单独的路由以启用不同字段的搜索条件?