public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } Blouse = await _context.Blouse.FindAsync(id); if (Blouse == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid?id) { if (id == null) { return(NotFound()); } Blouse = await _context.Blouse.FindAsync(id); if (Blouse != null) { _context.Blouse.Remove(Blouse); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(Guid?id, bool?saveChangesError = false) { if (id == null) { return(NotFound()); } Blouse = await _context.Blouse.FirstOrDefaultAsync(m => m.Id == id); if (Blouse == null) { return(NotFound()); } if (saveChangesError.GetValueOrDefault()) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } Blouse = await _context.Blouse .Include(m => m.Models) .ThenInclude(c => c.Colors) .Include(s => s.Models) .ThenInclude(s => s.Size) .AsNoTracking() .FirstOrDefaultAsync(m => m.Id == id); if (Blouse == null) { return(NotFound()); } return(Page()); }
// To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } var emptyBlouse = new Blouse(); if (await TryUpdateModelAsync <Blouse>(emptyBlouse, "blouse", b => b.Brand)) { _context.Blouse.Add(emptyBlouse); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); } return(null); }
public girlsSchoolUniform() { MiniSkirt schoolSkirt = new MiniSkirt(); schoolSkirt.ObjectName = "skirt"; schoolSkirt.colour = "navy blue"; schoolSkirt.Description = "pretty school skirt"; Blouse schoolBlouse = new Blouse(); schoolBlouse.ObjectName = "blouse"; schoolBlouse.Description = "almost sexy school blouse"; Panties cottonPanties = new Panties(); cottonPanties.colour = "white"; cottonPanties.Description = "plain cotton panties"; cottonPanties.ObjectName = "panties"; this.clothing.Add(schoolSkirt.ObjectName, schoolSkirt); this.clothing.Add(schoolBlouse.ObjectName, schoolBlouse); this.clothing.Add(cottonPanties.ObjectName, cottonPanties); }