我正在使用实体框架,我想通过 wcf 服务公开一些方法;
我有这个功能(在cs页面上)
using (ICRMEntities oContext = RemClient.Create<ICRMEntities>())
oContext.FindByKey<DataLib.Models.CRM.ActivitySLA>("ActivitySLA", SLAID);
这个函数的内容是
public static T FindByKey<T>(this IQueryable<T> oQuery, int keyValue) where T : EntityObject, ISimpleBaseClassMD
{
return oQuery.FindByKey<T>(keyValue, null);
}
WCF服务中定义的接口为:
public interface ICRMEntities : IDisposable, IContextWithUser
T FindByKey<T>(string sObjectTypeCode, int keyValue, bool bRequestValue) where T : EntityObject, ISimpleBaseClassMD;
WCF 中的这个泛型方法存在问题;我如何包装这个方法来保存这个功能?