Esempio n. 1
0
 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());
     }
 }
Esempio n. 2
0
 public Task <long> Create(Book book)
 {
     return(WithConnection((connection, transaction) =>
     {
         return _bookManager.Create(book, connection, transaction);
     }));
 }
Esempio n. 3
0
 public async Task Create(CreateBookInput input)
 {
     var book = _mapper.Map <Book>(input);
     await _bookManager.Create(book);
 }
Esempio n. 4
0
 public async Task Create(CreateBookInput input)
 {
     Book output = ObjectMapper.Map <Book>(input);
     await _bookManager.Create(output);
 }
Esempio n. 5
0
        public async Task <ClassRoomDto> Create([FromBody] ClassRoomCreateRequest request)
        {
            await _validatorCreateRequest.ValidateAndThrowAsync(request);

            return(await _entityManager.Create(request));
        }