public async Task <IHttpActionResult> CreateAsync(LectureDto data)
        {
            var result = await _lectureService.CreateAsync(data);

            if (result == null)
            {
                return(BadRequest());
            }
            return(Ok(result));
        }
Esempio n. 2
0
        public async Task <ActionResult <Lecture> > Post(LectureViewModel lectureViewModel)
        {
            if (lectureViewModel == null)
            {
                return(BadRequest());
            }

            var lecture = _mapper.Map <LectureDTO>(lectureViewModel);
            await _db.CreateAsync(lecture);

            return(Ok(lectureViewModel));
        }
Esempio n. 3
0
        public async Task <ActionResult <LectureModel> > Create(LectureModel model)
        {
            var lecture = await lectureService.CreateAsync(model);

            return(Ok(lecture));
        }