public async Task <ActionResult <Assignedtesttable> > PostAssignedtesttable(Assignedtesttable assignedtesttable) { _context.Assignedtesttable.Add(assignedtesttable); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAssignedtesttable", new { id = assignedtesttable.AssignedTestId }, assignedtesttable)); }
public async Task <IActionResult> PutAssignedtesttable(int id, Assignedtesttable assignedtesttable) { if (id != assignedtesttable.AssignedTestId) { return(BadRequest()); } _context.Entry(assignedtesttable).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssignedtesttableExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public int AssignToStudent(AssigntoStudentModel model) { Assignedtesttable obj = new Assignedtesttable(); obj.TestId = model.TaskId; obj.EmailId = model.StudentId; _context.Assignedtesttable.Add(obj); _context.SaveChanges(); return(obj.AssignedTestId); }