public void OnGet() { if (string.IsNullOrWhiteSpace(SearchString)) { Project = _context.GetAll().ToList(); } else { Project = _context.FindAll(m => (m.Title.Contains(SearchString) || m.Description.Contains(SearchString))).ToList(); } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Task = await _taskContext.FindOrDefault(id.Value); if (Task == null) { return(NotFound()); } ViewData["ProjectId"] = new SelectList(_projectDatabase.GetAll(), "Id", "Title"); return(Page()); }
public ActionResult <List <ProjectDto> > Get() { return(_projectDatabase.GetAll().Select(d => ProjectDto.FromProject(d)).ToList()); }