Exemplo n.º 1
0
 public RequestCreateSubject(DtoCreateSubject dto)
 {
     Endpoint    = "/subjects";
     ContentBody = new StringContent(
         JsonConvert.SerializeObject(dto));
     ContentBody.Headers.ContentType
         = MediaTypeHeaderValue.Parse("application/json");
 }
Exemplo n.º 2
0
        public async Task <AnswerBase> CreateSubjectAsync(DtoCreateSubject dto)
        {
            var prepod = await _prepods.GetPrepodByEmailAsync(dto.PrepodMail);

            await _repoSubjects.AddSubjectnAsync(new Subject
            {
                PrepodId = prepod.Id,
                Name     = dto.SubjectName
            });

            return(new AnswerSuccess {
            });
        }
Exemplo n.º 3
0
 public async Task <IActionResult> Post([FromBody] DtoCreateSubject dto)
 => Ok(await _servSubjects.CreateSubjectAsync(dto));