예제 #1
0
        public async Task <ActionResult <Assignedtesttable> > PostAssignedtesttable(Assignedtesttable assignedtesttable)
        {
            _context.Assignedtesttable.Add(assignedtesttable);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAssignedtesttable", new { id = assignedtesttable.AssignedTestId }, assignedtesttable));
        }
예제 #2
0
        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());
        }
예제 #3
0
        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);
        }