public async Task <ActionResult> Create(CreatePublisherInput input) { try { await _publisherService.CreateAsync(input); return(Ok()); } catch (Exception ex) { return(NotFound(ex)); } }
public async Task CreateAsync(CreatePublisherInput input) { try { var newPub = new Publisher { Name = input.Name }; _context.Publishers.Add(newPub); await _context.SaveChangesAsync(); } catch (Exception err) { throw err; } }