Tuesday, 13 August 2013

ServiceStack DTO For Dropdown Lists

ServiceStack DTO For Dropdown Lists

I have a request object for a POST in a ServiceStack service that looks
like this:
[Route("/jtip/cases/search", "POST")]
public class FindAgencyCases : IReturn<List<AgencyCaseResponse>>
{
public int? AgencyId { get; set; }
public string AgencyCaseNumber { get; set; }
public int? ServiceId { get; set; }
public string IndividualFirstName { get; set; }
public string IndividualLastName { get; set; }
public string CompanyName { get; set; }
public string LicenseNumber { get; set; }
public string LicenseState { get; set; }
public string IndividualType { get; set; }
public DateTime? RequestStartDate { get; set; }
public DateTime? RequestEndDate { get; set; }
public string Status { get; set; }
public int? ResultsLimit { get; set; }
}
The values for AgencyId, ServiceId, etc need to come from dropdown lists.
This DTO doesn't care how it gets those values, but I need to provide
collections for my agencies, services, etc.
Because this is a request object, I can't grab my lists from the database
and send them to the client. So how would I go about getting the lists for
my dropdowns (in an HTML form) that contain the values to populate the
above request DTO? I'm I overlooking something really obvious?

No comments:

Post a Comment