public async Task CreateCustomerAsync()

in src/Relecloud.Web.CallCenter.Api/Services/SqlDatabaseConcertRepository/SqlDatabaseConcertRepository.cs [151:174]


        public async Task<CreateResult> CreateCustomerAsync(Customer newCustomer)
        {
            if (string.IsNullOrEmpty(newCustomer.Email))
            {
                throw new ArgumentNullException(nameof(newCustomer.Email));
            }

            var customer = await this.database.Customers
                .FirstOrDefaultAsync(c => c.Email.ToLower() == newCustomer.Email.ToLower());
            if (customer == null)
            {
                customer = new Customer
                {
                    Id = newCustomer.Id,
                    Email = newCustomer.Email,
                    Name = newCustomer.Name,
                    Phone = newCustomer.Phone,
                };
                this.database.Customers.Add(customer);
                await this.database.SaveChangesAsync();
            }

            return CreateResult.SuccessResult(customer.Id);
        }