title: System.InvalidOperationException: 'No suitable constructor found for entity type 'HealthCheck'
body: <p>I get this error when trying to add something on my db through EF Core. </p>
  
  <blockquote>
    <p>System.InvalidOperationException: 'No suitable constructor found for
    entity type 'HealthCheck'. The following constructors had parameters
    that could not be bound to properties of the entity type: cannot bind
    'hctype' in 'HealthCheck(string title, string hctype, string link)'.'</p>
  </blockquote>
  
  <p>This is my HealthCheck class:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  
  namespace Application.Models
  {
      public class HealthCheck
      {
          public HealthCheck(string title, string hctype, string link)
          {
              Title = title;
              HCType = hctype;
              Link = link;
          }
  
          public int Id { get; set; }
          public string Title { get; set; }
          public string HCType { get; set; }
          public string Link { get; set; }
      }
  }
  
  </code></pre>
  
  <p>My RepositoryContext</p>
  
  <pre><code>using Microsoft.EntityFrameworkCore;
  using Application.Models;
  
  namespace Application.Repository
  {
      public class RepositoryContext : DbContext
      {
          protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          {
              optionsBuilder.UseSqlServer(
                  @"Server=(localdb)\mssqllocaldb;Database=healthcheck;Integrated Security=True");
          }
  
          //public DbSet&lt;HealthCheck&gt; HealthChecks { get; set; }
          //public DbSet&lt;UserHealthCheck&gt; UserHealthChecks { get; set; }
  
          protected override void OnModelCreating(ModelBuilder modelBuilder)
          {
              modelBuilder.Entity&lt;HealthCheck&gt;().ToTable("HealthCheck");
              modelBuilder.Entity&lt;UserHealthCheck&gt;().ToTable("UserHealthCheck");
          }
      }
  }
  
  </code></pre>
  
  <p>My Repository</p>
  
  <pre><code>using Application.Models;
  
  namespace Application.Repository
  {
      public class Repository
      {
          public void InsertHealthCheck(HealthCheck healthCheck)
          {
              using (var db = new RepositoryContext())
              {
                  db.Add(healthCheck);
                  db.SaveChanges();
              }
          }
      }
  }
  
  </code></pre>
  
  <p>And this is where "InsertHealthCheck()" is being called from </p>
  
  <pre><code>[Route("/api/HealthCheck/Website")]
          [HttpPost]
          public ActionResult WebsiteStatus([FromBody] WebsiteDataModel websiteData)
          {
              HealthCheck data = new HealthCheck(websiteData.Title, "Website", websiteData.Url);
              try
              {
                  HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(websiteData.Url);
                  HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
                  HttpStatusCode HealthCheckStatusCode = myHttpWebResponse.StatusCode;
                  myHttpWebResponse.Close();
                  return Ok(HealthCheckStatusCode);
              }
              catch(UriFormatException)
              {
                  return Ok("Check url.");
              }
              catch (Exception)
              {
                  return Ok("400");
              }
              finally
              {
                  repository.InsertHealthCheck(data);
              }
          }
  
  </code></pre>
  
  <p>If you can give me a hand I would appreciate it, if you need for me to post any other part of the code just ask.</p>
  
  <p>Also, I literally just started learning EF Core, so if I did something really stupid, point it out</p>