Esempio n. 1
0
        public async Task <ActionResult <responsetorespone> > Postresponsetorespone(responsetorespone responsetorespone)
        {
            _context.responsetorespone.Add(responsetorespone);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getresponsetorespone", new { id = responsetorespone.id }, responsetorespone));
        }
Esempio n. 2
0
        public async Task <IActionResult> Putresponsetorespone(int id, responsetorespone responsetorespone)
        {
            if (id != responsetorespone.id)
            {
                return(BadRequest());
            }

            _context.Entry(responsetorespone).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!responsetoresponeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Create([Bind("id,idofresponse,idofstudent,Containt,time")] responsetorespone responsetoComment)
        {
            if (ModelState.IsValid)
            {
                _context.responsetorespone.Add(responsetoComment);
                await _context.SaveChangesAsync();

                return(Redirect("http://localhost:4200/HomePage/" + responsetoComment.idofstudent));
            }
            return(View(responsetoComment));
        }