public static class MrpPraFindSuggestionForSelectionFactory
{
public static IMrpPraFindSuggestionForSelection<T> Create<T>() where T : Ufida.T.EAP.Domains.DTO, Ufida.T.MP.DTO.ITransferDTO;
}
public class BM
{
public IList<K> FindForSelection<K>(string selectedFields, string whereOql, IDictionary<string, object> otherconditions)
{
IMrpPraFindSuggestionForSelection<K> findforSelection = MrpPraFindSuggestionForSelectionFactory.Create<K>();
return findforSelection.FindForSelection(selectedFields, whereOql, otherconditions); }
}但是编译的时候发生错误;
不能将类型“K”用作泛型类型或方法“MrpPraFindSuggestionForSelectionFactory.Create<T>()”中的类型形参“T”。没有从“K”到“Ufida.T.EAP.Domains.DTO”的装箱转换或类型形参转换。 想问一下这个问题应该怎么解决阿?
{
public static IMrpPraFindSuggestionForSelection<T> Create<T>() where T : Ufida.T.EAP.Domains.DTO, Ufida.T.MP.DTO.ITransferDTO;
}
public class BM
{
public IList<K> FindForSelection<K>(string selectedFields, string whereOql, IDictionary<string, object> otherconditions)
{
IMrpPraFindSuggestionForSelection<K> findforSelection = MrpPraFindSuggestionForSelectionFactory.Create<K>();
return findforSelection.FindForSelection(selectedFields, whereOql, otherconditions); }
}但是编译的时候发生错误;
不能将类型“K”用作泛型类型或方法“MrpPraFindSuggestionForSelectionFactory.Create<T>()”中的类型形参“T”。没有从“K”到“Ufida.T.EAP.Domains.DTO”的装箱转换或类型形参转换。 想问一下这个问题应该怎么解决阿?
这个k,跟T有没有关系?K这个类型有没有定义?
{
IMrpPraFindSuggestionForSelection<K> findforSelection = MrpPraFindSuggestionForSelectionFactory.Create<K>();
return findforSelection.FindForSelection(selectedFields, whereOql, otherconditions);
}