.net 实体框架异常:不存在从对象类型System.Data.Objects.ObjectParameter到已知托管提供程序本机类型的映射
我创建了一个返回动态结果集的SP,因此我创建了一个复杂类型,用于将结果集映射到实体。在执行此过程时,我遇到了异常 不存在从对象类型System.Data.Objects.ObjectParameter到已知托管提供程序本机类型的映射 以下是EDMX自动创建的函数.net 实体框架异常:不存在从对象类型System.Data.Objects.ObjectParameter到已知托管提供程序本机类型的映射,.net,entity-framework,.net,Entity Framework,我创建了一个返回动态结果集的SP,因此我创建了一个复杂类型,用于将结果集映射到实体。在执行此过程时,我遇到了异常 不存在从对象类型System.Data.Objects.ObjectParameter到已知托管提供程序本机类型的映射 以下是EDMX自动创建的函数 public int GetKpiComparisonResults(Nullable<global::System.Int32> p_primary_org_unit_surrogate_key, global::Sys
public int GetKpiComparisonResults(Nullable<global::System.Int32> p_primary_org_unit_surrogate_key, global::System.String p_org_unit_surrogate_key_csv, global::System.String p_industry_code, global::System.String p_country_code, Nullable<global::System.Boolean> p_period_type, Nullable<global::System.Int32> p_start_year, Nullable<global::System.Int32> p_end_year, Nullable<global::System.Int32> p_start_period, Nullable<global::System.Int32> p_end_period, ObjectParameter p_sql_errcode, ObjectParameter p_sql_errmsg)
{
//here i am declaring the parametrs
return base.ExecuteFunction("GetKpiComparisonResults", p_primary_org_unit_surrogate_keyParameter, p_org_unit_surrogate_key_csvParameter, p_industry_codeParameter, p_country_codeParameter, p_period_typeParameter, p_start_yearParameter, p_end_yearParameter, p_start_periodParameter, p_end_periodParameter, p_sql_errcode, p_sql_errmsg);
}
我需要一个复杂类型的结果。所以我改变了如下的方法
public ObjectResult<KpiComparisonResult> GetKpiComparisonResults(Nullable<global::System.Int32> p_primary_org_unit_surrogate_key, global::System.String p_org_unit_surrogate_key_csv, global::System.String p_industry_code, global::System.String p_country_code, Nullable<global::System.Boolean> p_period_type, Nullable<global::System.Int32> p_start_year, Nullable<global::System.Int32> p_end_year, Nullable<global::System.Int32> p_start_period, Nullable<global::System.Int32> p_end_period, ObjectParameter p_sql_errcode, ObjectParameter p_sql_errmsg)
{
//here i am declaring the parametrs
return base.ExecuteStoreQuery<KpiComparisonResult>("GetKpiComparisonResults", p_primary_org_unit_surrogate_keyParameter, p_org_unit_surrogate_key_csvParameter, p_industry_codeParameter, p_country_codeParameter, p_period_typeParameter, p_start_yearParameter, p_end_yearParameter, p_start_periodParameter, p_end_periodParameter, p_sql_errcode, p_sql_errmsg);
}
执行此方法时,我遇到异常?如何在EntityFramework中管理动态结果集?可能与的重复我认为这是一个一般性的例外。如何管理动态结果集?