コード例 #1
0
        public async Task <IActionResult> AddMarksForGivenSubject(int id, int studentId, [FromBody] Mark mark)
        {
            //await

            try
            {
                await _subjectsRepository.CreateMarkForSubject(id, mark).ConfigureAwait(false);

                return(CreatedAtRoute("GetMarksForSubject", new { controller = "Subjects", id, studentId }, mark));
            }
            catch (Exception exception)
            {
                return(HttpBadRequest(exception.Message));
            }
        }