public async Task <IActionResult> OnPostCreateCustomer() { MemoryStream stream = new MemoryStream(); Request.Body.CopyTo(stream); stream.Position = 0; using (StreamReader reader = new StreamReader(stream)) { string requestBody = reader.ReadToEnd(); if (requestBody.Length > 0) { var obj = JsonConvert.DeserializeObject <CustomerDTO>(requestBody); if (obj != null) { await _service.CreateCustomerAsync(obj); } } } return(new JsonResult("Thành công")); }