Having trouble retrieving data from an ASP.NET Core 2.0 Web API with Angular 5+.
The steps taken so far are as follows:
- An ASP.NET Core 2.0 Web API was created and deployed on a server. Data can be successfully retrieved using Postman or Swagger.
- Using NSwagStudio, TypeScript service classes were generated for the Angular frontend app.
The current issue: Although requests to the web API from the frontend app return the correct data in JSON format, there seems to be a problem during the mapping process to the poco object in the generated client service class. The resulting object has empty attributes.
Below is the code snippet:
product.service.ts
export class ProductService {
...
The methods from the Product-class are shown below:
init(data?: any) {
...
Upon inspecting data in the init() method, all necessary values are present. However, when trying to access specific values like data["ProductId"], they appear to be null/undefined.
Requesting assistance from anyone familiar with this issue.
Thank you
A screenshot of the console output displaying the data object can be viewed here: enter image description here