コード例 #1
0
        // Ready
        private void PutInvitationVerificationSatus(StudyGroupInvitations UpdatedViewInvitation)
        {
            Busy = true;
            var postUrl = "https://altaarefapp.azurewebsites.net/api/StudyGroupInvitations/" + UpdatedViewInvitation.StudentId;

            var content  = new StringContent(JsonConvert.SerializeObject(UpdatedViewInvitation), Encoding.UTF8, "application/json");
            var response = _client.PutAsync(postUrl, content);

            Busy = false;
        }
コード例 #2
0
        public async Task <IActionResult> PutStudyGroupInvitations([FromRoute] int StudentId, [FromBody] StudyGroupInvitations studyGroupInvitations)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (StudentId != studyGroupInvitations.StudentId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }