示例#1
0
 private static IEnumerable<SearchResult> GetInitiativeTasks()
 {
     var context = new InitiativeDbContext();
     var initiativeTasks = context.InitiativeTasks.ToList();
     return initiativeTasks.Select(initiativeTask =>
         new SearchResult
         {
             EntityId = initiativeTask.Id,
             EntityTypeName = "InitiativeTasks",
             SearchTitle = initiativeTask.TaskName,
             SearchBody = initiativeTask.TaskName + " " + initiativeTask.Description
         });
 }
示例#2
0
 private static IEnumerable<SearchResult> GetInitiatives()
 {
     var context = new InitiativeDbContext();
     var initiatives = context.Initiatives.ToList();
     return initiatives.Select(initiative =>
         new SearchResult
         {
             EntityId = initiative.Id,
             EntityTypeName = "Initiatives",
             SearchTitle = initiative.Name,
             SearchBody = initiative.Name
         });
 }