0
在我的部分類中定義了一個函數,它返回使用我的* .dbml文件中定義的類從存儲過程中返回多個結果形狀的IMultipleResults類型,出於某種原因,[ResultType(typeof(MyType))]
isn沒有工作。 MyType
是說它無法找到。該函數位於我的.dbml
文件的.cs
文件中,並且該類型肯定位於我的dbml文件中。IMultipleResults LINQ DBML類未解決
關於爲什麼找不到它的任何想法?這裏有一個想法:
using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Reflection;
namespace IntranetMvcAreas
{
partial class ContractsControlDataContext : DataContext
{
[Function(Name = "dbo.procCC_Contract_Select")]
[ResultType(typeof(Contract))]
[ResultType(typeof(ContractCostCentre))]
[ResultType(typeof(tblCC_Contract_Data_Terminal))]
[ResultType(typeof(tblCC_CDT_Data_Service))]
[ResultType(typeof(tblCC_Data_Service))]
public IMultipleResults procCC_Contract_Select(
[Parameter(Name = "ContractID", DbType = "Int")] System.Nullable<int> ContractID,
[Parameter(Name = "ResponsibilityKey", DbType = "Int")] System.Nullable<int> ResponsibilityKey,
[Parameter(Name = "ExpenseType", DbType = "Char")] System.Nullable<char> ExpenseType,
[Parameter(Name = "SupplierID", DbType = "Int")] System.Nullable<int> SupplierID)
{
IExecuteResult result = this.ExecuteMethodCall(this, (MethodInfo)(MethodInfo.GetCurrentMethod()), ContractID, ResponsibilityKey, ExpenseType, SupplierID);
return (IMultipleResults)result.ReturnValue;
}
}
}
在typeof
所有類型不能被發現,儘管DBML文件之中。