Ejemplo n.º 1
0
 // 입력
 public async Task <Customer> AddAsync(Customer model)
 {
     _context.Add(model);
     try
     {
         await _context.SaveChangesAsync();
     }
     catch (Exception exp)
     {
         _logger.LogError($"Error in {nameof(AddAsync)}: " + exp.Message);
     }
     return(model);
 }
Ejemplo n.º 2
0
        // 입력
        public async Task <Customer> AddAsync(Customer model)
        {
            try
            {
                _context.Customers.Add(model);
                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                _logger.LogError($"에러 발생({nameof(AddAsync)}): " + e.Message);
            }

            return(model);
        }
Ejemplo n.º 3
0
        // 입력
        public async Task <Product> AddAsync(Product model)
        {
            try
            {
                _context.Products.Add(model);
                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                _logger.LogError($"ERROR({nameof(AddAsync)}): " + e.Message);
            }

            return(model);
        }