public ActionResult Create(BookViewModel book) { try { List <AuthorDTO> authors = new List <AuthorDTO>(); for (int i = 0; i < book.SelectedAuthorId.Count; i++) { authors.Add(authorService.GetAuthor(book.SelectedAuthorId[i])); } var bookCreate = new BookDTO() { Title = book.Title, Theme_Id = book.SelectedThemeId, Price = book.Price, PenaltyType = Library.DAL.Entities.Penalty.Medium, //Authors = authors }; bookService.Create(bookCreate, book.SelectedAuthorId); return(RedirectToAction("Index")); } catch { return(View()); } }
public Task <long> Create(Book book) { return(WithConnection((connection, transaction) => { return _bookManager.Create(book, connection, transaction); })); }
public async Task Create(CreateBookInput input) { var book = _mapper.Map <Book>(input); await _bookManager.Create(book); }
public async Task Create(CreateBookInput input) { Book output = ObjectMapper.Map <Book>(input); await _bookManager.Create(output); }
public async Task <ClassRoomDto> Create([FromBody] ClassRoomCreateRequest request) { await _validatorCreateRequest.ValidateAndThrowAsync(request); return(await _entityManager.Create(request)); }