public IActionResult Get([FromQuery] int?id, string include, string q, bool?active) { if (id != null) { var customer = _customers.GetCustomerById(id); return(Ok(customer)); } if (include != null) { if (include == "products") { return(Ok(_customers.GetCustomersWithProducts())); } if (include == "payments") { return(Ok(_customers.GetCustomersWithPayments())); } } if (q != null) { return(Ok(_customers.GetCustomersByTerm(q))); } if (active != null) { return(Ok(_customers.GetCustomersWithOrders(active))); } var allCustomers = _customers.GetCustomers(); return(Ok(allCustomers)); }