Wcf RestSharp在实体框架中抛出错误
字符串URL=”https://sampleservicebus.servicebus.windows.net/WinPhoneService/"Wcf RestSharp在实体框架中抛出错误,wcf,entity-framework,c#-4.0,wcf-rest,restsharp,Wcf,Entity Framework,C# 4.0,Wcf Rest,Restsharp,字符串URL=”https://sampleservicebus.servicebus.windows.net/WinPhoneService/" 事实上,当我调试服务代码时,我能够看到KPIDomainData的所有值都以null的形式发送到方法中..尽管我正在发送值。请帮助我了解为什么KPIDomainData的属性以null的形式发送到服务中,甚至im传递值 RestClient client = new RestClient(URL); RestRequest request
事实上,当我调试服务代码时,我能够看到KPIDomainData的所有值都以null的形式发送到方法中..尽管我正在发送值。请帮助我了解为什么KPIDomainData的属性以null的形式发送到服务中,甚至im传递值
RestClient client = new RestClient(URL);
RestRequest request = new RestRequest("getkpimeasuredata", Method.POST);
KpiDomainData kpidata = new KpiDomainData();
kpidata.KPIId = 1006;
kpidata.ScorecardId = 3;
kpidata.EngineeringOrgId = 11;
kpidata.DataValuetypeId = 1;
kpidata.CumulativeMonth = 463;
kpidata.BusinessOrgId = 1;
string json = Newtonsoft.Json.JsonConvert.SerializeObject(kpidata);
json = "{\"kpidata\" : " + json + "}";
request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);
request.RequestFormat = DataFormat.Json;
ObservableCollection<KpiMeasureData> kpiDetailsList = await client.ExecuteTaskAsync<ObservableCollection<KpiMeasureData>>(request);
client.ExecuteAsync(request, response =>
{
if (response.StatusCode == HttpStatusCode.OK)
{
}
});
{"ErrorCode":"1001","ErrorMessage":"System.Data.EntityCommandExecutionException: The data reader is incompatible with the specified 'ScaasModel.GetKPIMeasureData_Result'. A member of the type, 'ParamName', does not have a corresponding column in the data reader with the same name.\u000d\u000a at System.Data.Query.InternalTrees.ColumnMapFactory.GetColumnMapsForType(DbDataReader storeDataReader, EdmType edmType, Dictionary`2 renameList)\u000d\u000a at System.Data.Query.InternalTrees.ColumnMapFactory.CreateColumnMapFromReaderAndType(DbDataReader storeDataReader, EdmType edmType, EntitySet entitySet, Dictionary`2 renameList)\u000d\u000a at