예제 #1
0
        // GET: Applications/Delete/5
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var application = await _context.Applications
                              .Include(a => a.Opportunity)
                              .Include(a => a.Occurrences)
                              .ThenInclude(o => o.Occurrence)
                              .Include(a => a.User)
                              .AsNoTracking()
                              .SingleOrDefaultAsync(m => m.Id == id);

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

            return(View(ApplicationView.FromApplication(application)));
        }