public async Task <ActionResult <maintable> > Postmaintable(maintable maintable) { _context.maintable.Add(maintable); await _context.SaveChangesAsync(); return(CreatedAtAction("Getmaintable", new { id = maintable.midex }, maintable)); }
public async Task <IActionResult> Putmaintable(int id, maintable maintable) { if (id != maintable.midex) { return(BadRequest()); } _context.Entry(maintable).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!maintableExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public JsonResult MuseumFirstPageId([FromBody] maintable maintable) { var Mbase = "Not found"; var Mname = "Not found"; var searchMuseum = _context.maintable.FirstOrDefault(m => m.midex == maintable.midex); if (searchMuseum != null) { Mname = searchMuseum.mname; Mbase = searchMuseum.mbase; } var returnMesg = new { mname = Mname, mbase = Mbase }; return(Json(returnMesg)); }
public JsonResult MuseumFirstPageName([FromBody] maintable maintable) { var searchMuseum = _context.maintable.Where(m => m.mname.Contains(maintable.mname)); return(Json(new { searchMuseum })); }