hello,
Error 1 Cannot implicitly convert type 'System.Collections.Generic.List
Model:
public class SickLeaveData
{
public string Pat_MR { get; set; }
public Boolean IsCitizen { get; set; }
public string MedicalRecordID { get; set; }
public string PatientID { get; set; }
}
API Controller: public class SickLeaveController : ApiController
{
public HttpResponseMessage Get()
{
List sickleavegetdata = new List();
using (MedicalHL7Entities1 dc = new MedicalHL7Entities1())
{
sickleavegetdata = dc.B_HIS_Demog_Pat_Mstr.OrderBy(a => a.Pat_MR).ToList();
HttpResponseMessage response;
response = Request.CreateResponse(HttpStatusCode.OK, sickleavegetdata);
return response;
}
}
}

Sreekanth ReddyRank #726 · 3.2K reputationPosted Dec 25, 2018, 12:47 AM EST
Ehsan SajjadRank #512 · 4.8K reputationPosted Dec 25, 2018, 1:19 AM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Dec 24, 2018, 11:20 PM EST
mohammed IrshadRank #8,108 · 228 reputationPosted Dec 25, 2018, 12:35 AM EST
mohammed IrshadRank #8,108 · 228 reputationPosted Dec 25, 2018, 1:05 AM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 25, 2018, 5:50 PM EST
mohammed IrshadRank #8,108 · 228 reputationPosted Dec 25, 2018, 7:21 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 26, 2018, 8:35 PM EST