public async Task <IActionResult> PostAsync([FromBody] DrugDetails drugDetails) { string filePath = @"c:\FileData\Filedata.txt";; var result = await _couchRepository.WriteTextAsync(filePath, drugDetails); if (result.Length > 0) { // var sResult = JsonConvert.DeserializeObject<SavedResult>(result.SuccessContentObject); return(Ok(result)); } return(BadRequest()); }
public async Task <IActionResult> PostAsync([FromBody] DrugDetails drugDetails) { _logger.LogInformation("writing to text file data {0} {1}", drugDetails.DrugName, drugDetails.DrugExpiredOn, drugDetails.LotNo); _logger.LogTrace("writing to text file data {0} {1}", drugDetails.DrugName, drugDetails.DrugExpiredOn, drugDetails.LotNo); string filePath = @"c:\FileData\Filedata.txt";; var result = await _couchRepository.WriteTextAsync(filePath, drugDetails); if (result.Length > 0) { _logger.LogInformation("data written to file sucessfully"); _logger.LogTrace("data written to file sucessfully"); return(Ok(result)); } return(BadRequest()); }