Autocomplete service center name

This commit is contained in:
2015-10-12 22:45:36 -04:00
parent d87f654a20
commit 49c55ffba6
6 changed files with 39 additions and 1 deletions
+17
View File
@@ -858,6 +858,23 @@ namespace MileageTraker.Web.DAL
return vehicleServices;
}
public IQueryable<string> GetServiceCenterNames()
{
return
from l in GetVehicleServices()
group l by new {l.ServiceCenterName}
into g
select g.Key.ServiceCenterName;
}
public IEnumerable<string> GetServiceCenterNamesAutocomplete(string term)
{
return
from name in GetServiceCenterNames()
where name.StartsWith(term)
select name;
}
#endregion
}