Begin adding fluxnet site autocomplete

This commit is contained in:
2016-01-29 12:40:00 -05:00
parent 7e4d475260
commit c5fcb8d635
5 changed files with 47 additions and 6 deletions
+11 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using LeafWeb.Core.Models;
namespace LeafWeb.Core.DAL
@@ -22,10 +23,19 @@ namespace LeafWeb.Core.DAL
#region Fluxnet Sites
public IEnumerable<FluxnetSite> GetFluxnetSites()
public IQueryable<FluxnetSite> GetFluxnetSites()
{
return _db.FluxnetSites;
}
public IQueryable<FluxnetSite> GetFluxnetSitesAutocomplete(string term)
{
return
from fs in GetFluxnetSites()
where fs.FluxnetId.StartsWith(term)
|| fs.SiteName.Contains(term)
select fs;
}
#endregion
}
}