예제 #1
0
        public async Task <ActionResult> Create(CreatePublisherInput input)
        {
            try
            {
                await _publisherService.CreateAsync(input);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(NotFound(ex));
            }
        }
예제 #2
0
 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;
     }
 }