I get this error
Error Cannot convert type
TestMVC.GetServiceRequests.serviceRequests[]toSystem.Collections.Generic.IEnumerable<TestMVC.Models.ServiceRequest>
I'm trying to copy .net object array from webservice into another .net c# object array and they both have the same structure.
I tried type casting but this did not work.
var serviceRequest = svcClient.GetServiceRequests(getServiceRequest).responseData;
return (IEnumerable<ServiceRequest>) serviceRequests;
ServiceRequest[] serviceRequests = new ServiceRequest[]
{
new ServiceRequest { customerName = "Customer123", contactName = "Pat Nelson", vin = "4DRBUAFN75A977722", unitNo = "275", serviceRequestId = "1", requestedDate = "08/08/15", requestedTime = "PM", connectCompleted = "true",
captureCompleted = "false", collectCompleted = "false", agreeCompleted = "false", updateDate = "08/17/2015", createDate = "08/17/2015", note = "note note note note note note note note note note note note note note note note note note note note note note note note note note ", userId = "yyy1ri3"},
new ServiceRequest { customerName = "Customer456", contactName = "Pat Nelson", vin = "1HSMTAAN1DH328986", unitNo = "325", serviceRequestId = "2", requestedDate = "09/01/15", requestedTime = "AM", connectCompleted = "false",
captureCompleted = "true", collectCompleted = "true", agreeCompleted = "false", updateDate = "08/17/2015", createDate = "08/17/2015", note = "note note note note note note note note note note note note note note note note note note note note note note note note note note ", userId = "yyy1ri3"},
};
serviceRequestsis not aServiceRequestso an array ofserviceRequestsshouldn't be considered an IEnumerable ofServiceRequest... unless you can show us the definition of theserviceRequestsclass and show us that it is.