title: InvalidCastException: Unable to cast object of type 'System.Guid' to type 'System.String'. in asp.net core webapi
body: <p>Hi I am creating a webapi in asp.net core when I call the controller it is throwing the error and this is have shows how i create the models and the controller.
   Model :</p>
  
  <pre><code>public class tblProject
  {
      [Key]
      public Guid prj_id { get; set; }
      public string prj_name { get; set; }
      public string prj_endcustomer { get; set; }
      public string prj_customer_name { get; set; }
      public string prj_client { get; set; }
      public string prj_scope_of_supply { get; set; }
      public int prj_revision { get; set; }
      public bool isactive { get; set; }
      public DateTime created_date { get; set; }
      public string created_by { get; set; }
  }
  </code></pre>
  
  <p>Controller :</p>
  
  <pre><code>[Route("api/[controller]")]
  [ApiController]
  public class CDProjectController : ControllerBase
  {
      private readonly CDDbcontext _context;
  
      public CDProjectController(CDDbcontext context)
      {
          _context = context;
      }
  
      // GET: api/DCandidate
      [HttpGet]
      public async Task&lt;ActionResult&lt;IEnumerable&lt;tblProject&gt;&gt;&gt; GetDCandidates()
      {
          return await _context.tblProject.ToListAsync();
      }
  
      // GET: api/DCandidate/5
      [HttpGet("{id}")]
      public async Task&lt;ActionResult&lt;tblProject&gt;&gt; GetDCandidate(Guid prj_id)
      {
          var dCandidate = await _context.tblProject.FindAsync(prj_id);
  
          if (dCandidate == null)
          {
              return NotFound();
          }
  
          return dCandidate;
      }
  </code></pre>