I've this GET method in my MVC Web Api:
public IQueryable<Employee> GetEmployeeByJobTitle(List<string> jobTitles)
{
var employeeByJobTitle = from e in db.Employee
where jobTitles.Contains(e.JobTitle)
select e;
return db.Employee;
}
because I need to get a set of employees by job titles. So if I want all employees with job Title in "Production Technician - WC60" and "Production Supervisor - WC60", I need to call this URI
As you can see the query string is huge and complex. Now, I need to call this method from a client console using HttpClient
class from Web.API.Client.Libraries
. Is there an easy way to create a method builting the above query string starting from the object:
var jobTitles = new List<string>
{
"Production Technician - WC60",
"Production Supervisor - WC60"
};
Something like
string BuiltUriFromObject(List<string> jobTitles){};