AspNetCorePostgreSQLDockerApp.Repository.CustomersRepository.UpdateCustomerAsync C# (CSharp) Method

UpdateCustomerAsync() public method

public UpdateCustomerAsync ( Customer customer ) : Task
customer AspNetCorePostgreSQLDockerApp.Models.Customer
return Task
        public async Task<bool> UpdateCustomerAsync(Customer customer)
        {
            //Will update all properties of the Customer
            _context.Customers.Attach(customer);
            _context.Entry(customer).State = EntityState.Modified;
            try
            {
              return (await _context.SaveChangesAsync() > 0 ? true : false);
            }
            catch (Exception exp)
            {
               _logger.LogError($"Error in {nameof(UpdateCustomerAsync)}: " + exp.Message);
            }
            return false;
        }