Hi,
I have a simple controller which will returning a list based on parameter
The schema is from service will give result list data then it will IQueryable based parameter
my problem is why is data result not filtered by param
thank you
public async Task<IActionResult> AssignRole(string SearchString)
{
List<ViewUser> user = new List<ViewUser>();
user = await _iuser.GetUser();
IQueryable<ViewUser> data = user.AsQueryable();
try
{
switch (SearchString)
{
case null:
data.ToList();
break;
default:
data.Where(m => m.user_name == SearchString).ToList();
break;
}
}
catch (Exception ex)
{
}
return View(data);
}