예제 #1
0
 public IEnumerable <ISmtp4devMessage> SearchMessages(string searchTerm)
 {
     lock (_syncRoot)
     {
         return(_database.AsQueryable <ISmtp4devMessage>()
                .Where(m =>
                       (m.Subject != null && m.Subject.IndexOf(searchTerm, StringComparison.OrdinalIgnoreCase) > -1) ||
                       m.To.Any(to => to.IndexOf(searchTerm, StringComparison.OrdinalIgnoreCase) > -1) ||
                       m.From.IndexOf(searchTerm, StringComparison.OrdinalIgnoreCase) > -1
                       )
                .OrderByDescending(m => m.ReceivedDate));
     }
 }
예제 #2
0
 /// <summary>
 /// Gets all recipes.
 /// </summary>
 /// <returns>A collection of all <see cref="Recipe"/> objects stored in the database.</returns>
 public IList <Recipe> GetAllRecipes()
 {
     return(_odb.AsQueryable <Recipe>().ToList());
 }
 public IQueryable <T> Get <T>()
 {
     return(_db.AsQueryable <T>());
 }