title: How can I get data from asp.net core webapi to angular 11.0.0 which is connected to database. I tried to do it but it returns empty records
body: <p>This get the data from asp.net core webapi which is connected to Microsoft SQL Server. I'm trying to fetch but it returns undefined records in the list</p>
  <pre><code>    This is Get method:
      
      refreshList(){
          this.http.get(this.baseURL).toPromise()
              .then(res =&gt; this.list = res as PaymentDetail[]);
      }
      
      this is the way to make it accessible to html page:
      constructor(public service : PaymentDetailService) { }
      
      ngOnInit(): void {
      
          this.service.refreshList();
      }
      
      
  </code></pre>
  <p>this the way I show in front End:</p>
  <pre><code>    &lt;div class=col-md-6&gt;
          &lt;table class=&quot;table&quot;&gt;
            &lt;thead class=&quot;thead-light&quot;&gt;
              &lt;tr&gt;
                &lt;th&gt;Card Owner&lt;/th&gt;
                &lt;th&gt;Card Number&lt;/th&gt;
                &lt;th&gt;Exp Date&lt;/th&gt;
                &lt;th&gt;&lt;/th&gt;
      
              &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody&gt;
              &lt;tr *ngFor=&quot;let pd of service.list&quot;&gt;
                &lt;td&gt;{{pd.CardHolder}}&lt;/td&gt;
                &lt;td&gt;{{pd.CardNumber}}&lt;/td&gt;
                &lt;td&gt;{{pd.ExpirationdDate}}&lt;/td&gt;
      
                &lt;td&gt;
                  &lt;i class=&quot;far fa-trash-alt fa-lg text-danger&quot;&gt;&lt;/i&gt;
                &lt;/td&gt;
              &lt;/tr&gt;
            &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/div&gt;
       
  </code></pre>