Ejemplo n.º 1
0
        public async Task <ActionResult> Post([FromBody] StudentsIdentity Student)
        {
            context.Add(Student);
            await context.SaveChangesAsync();

            return(new CreatedAtRouteResult("Student", new { id = Student.id }, Student));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Put(int id, [FromBody] StudentsIdentity Value)
        {
            if (id != Value.id)
            {
                return(BadRequest());
            }
            context.Entry(Value).State = EntityState.Modified;
            await context.SaveChangesAsync();

            return(Ok());
        }