Example #1
0
        public async Task Create(CustomerWriteModel customerModel)
        {
            HttpClient    httpClient = this.CreateHttpClient();
            StringContent content    = new StringContent(JsonConvert.SerializeObject(customerModel), Encoding.UTF8, "application/json");

            HttpResponseMessage response = await httpClient.PostAsync("/api/customer", content);

            response.EnsureSuccessStatusCode();
        }
Example #2
0
        public Task <bool> CreateCustomerAsync(CustomerWriteModel customer)
        {
            if (customer == null)
            {
                return(Task.FromResult(false));
            }

            _customers.Add(customer);

            return(Task.FromResult(true));
        }
Example #3
0
        public async Task <bool> CreateCustomerAsync(CreateCustomerDto customer)
        {
            var dataModel = new CustomerWriteModel
            {
                Name    = customer.Name,
                Address = customer.Address
            };

            var status = await _customerRepository.CreateCustomerAsync(dataModel);

            return(status);
        }
Example #4
0
 public async Task Create(CustomerWriteModel customer)
 {
     await this.customerWriteApiClient.Create(customer);
 }