Beispiel #1
0
        /// <summary>
        /// Gets the details for the strategic domain
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            //checks to see if id is null
            if (id == null)
            {
                return(NotFound());
            }

            //Grabs the strategic domain based off the id pased in
            StrategicDomain = await _context.StrategicDomains.FirstOrDefaultAsync(m => m.ID == id);

            //checks to see if the strategic domain queried is null
            if (StrategicDomain == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        /// <summary>
        /// Removes the strategic domain
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            //checks to see if id passed is null
            if (id == null)
            {
                return(NotFound());
            }

            //Gets the strategic domain based off of the id passed in
            StrategicDomain = await _context.StrategicDomains.FindAsync(id);

            //checks to see if strategic domain queried is not null and if not then remove the strategic domain
            if (StrategicDomain != null)
            {
                _context.StrategicDomains.Remove(StrategicDomain);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Details"));
        }