public async Task <IActionResult> OnGetAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Property = await _context.Properties
                       .Include(c => c.Client).FirstOrDefaultAsync(m => m.PropertyID == id);

            if (Property == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Property = await _context.Properties.FindAsync(id);

            if (Property != null)
            {
                _context.Properties.Remove(Property);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
예제 #3
0
        public async Task <IActionResult> OnGetAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Property = await _context.Properties
                       .Include(c => c.Client).FirstOrDefaultAsync(m => m.PropertyID == id);

            if (Property == null)
            {
                return(NotFound());
            }
            ViewData["ClintID"] = new SelectList(_context.Clients, "ID", "ID");
            return(Page());
        }