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(); }
public Task <bool> CreateCustomerAsync(CustomerWriteModel customer) { if (customer == null) { return(Task.FromResult(false)); } _customers.Add(customer); return(Task.FromResult(true)); }
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); }
public async Task Create(CustomerWriteModel customer) { await this.customerWriteApiClient.Create(customer); }