public async Task <ActionResult <List <ZwinnyCRUD.Common.Models.File> > > GetFiles([Required] int id)
        {
            var Project = await _projectDatabase.FindOrDefault(id);

            if (Project == null)
            {
                return(NotFound("Project with this id doesn't exist!"));
            }
            var File = await _fileDatabase.FindProjectFile(id);

            return(_fileDatabase.FindAll(m => (m.ProjectId.Equals(Project.Id))).ToList());
        }
Exemple #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Project = await _projectContext.FindOrDefault(id.Value);

            if (Project == null)
            {
                return(NotFound());
            }

            Project.Tasks = _taskContext.FindAll(e => e.ProjectId == id).ToList();
            File          = await _fileContext.FindProjectFile(id.Value);

            DatabaseFiles = _fileContext.FindAll(m => (m.ProjectId.Equals(Project.Id))).ToList();

            return(Page());
        }