i have code
public List<Files> List(int? menuId)
{
if (menuId == null)
{
return _dataContext.Files.ToList();
}
else
{
return _dataContext.Files.Where(f => f.Menu.MenuId == menuId).ToList();
}
}
is it possible to make it only one line like return _dataContext.Files.Where(f => f.Menu.MenuId == menuId).ToList();?