public async Task <AuthorResponseDto> CreateAuthor(CreateAuthorRequestDto request) { Devon4NetLogger.Debug("Entering CreateAuthor book on AuhtorService"); var author = await _authorRepository.Create(request.ToAuthor()).ConfigureAwait(false); return(author.ToAuthorResponse()); }
public static Author ToAuthor(this CreateAuthorRequestDto request) => new Author { Id = Guid.NewGuid(), Email = request.Email, Name = request.Name, Phone = request.Phone, Surname = request.Surname };
public AuthorResponseDto SaveAsync([FromBody] CreateAuthorRequestDto body) { return(_authorService.Save(body)); }
public async Task <IActionResult> Create([FromBody] CreateAuthorRequestDto requestDto) { Devon4NetLogger.Debug("Entering CreateAuthor on AuthorManagmentController"); return(Ok(await _authorService.CreateAuthor(requestDto).ConfigureAwait(false))); }