Skip to content
Advertisement

Unable to cast object of type ‘System.String’ to type ‘System.Boolean .Net Core MVC

I refer this tutorial https://github.com/bhrugen/AppointmentScheduler I did same code but I’m not able to show Get Calendar Data when I running it, It’s shows error – Unable to cast object of type ‘System.String’ to type ‘System.Boolean. My Code is :-

AppointmentApiController.cs :

JavaScript

Script.js :

JavaScript

AppointmentService.cs :

JavaScript

IAppointmentService.cs :

JavaScript

Advertisement

Answer

Unable to cast object of type ‘System.String’ to type ‘System.Boolean.

You need to make sure the type of IsDoctorApproved in AppointmentVM is bool:

JavaScript

Also,you need to make sure the type of IsDoctorApproved in your database is bool.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement