Esempio n. 1
0
 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();
     }
 }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
 public ActionResult <List <ProjectDto> > Get()
 {
     return(_projectDatabase.GetAll().Select(d => ProjectDto.FromProject(d)).ToList());
 }