I have this EF qQuery
[HttpGet]
public IActionResult GetCISCustomers(string Option, string Input)
{
using (var db = new cismodel.eedcbuildingdbContext())
{
var result = from a in db.ConsolidatedCustomerDatabase
where (a.AccountNo == Input)
select new
{
AccountNo = a.AccountNo
};
string json = Newtonsoft.Json.JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.Indented);
return Ok(json);
}
}
Is it possible to make the a.AccountNo
to be the (Option) parameter as I want users to be able to pass in different options such as (AccountNo, MeterNo, Name) and different input.