Exemplo n.º 1
0
        public async Task <ActionResult> Put(Guid id, [FromBody] CourseCreateEditDto dto)
        {
            if (id != dto.Id)
            {
                return(BadRequest());
            }
            await _service.UpdateAsync(dto.ToEntity());

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <CourseDto> > Post([FromBody] CourseCreateEditDto dto)
        {
            var created = await _service.CreateAsync(dto.ToEntity());

            return(Ok(created.ToDto()));
        }