通过将
class通用类型约束添加到扩展方法中,我能够解决此问题。不过,我不确定为什么会起作用。
public static T GetById<T>(this IQueryable<T> collection, Guid id) where T : class, IEntity{ //...}
通过将
class通用类型约束添加到扩展方法中,我能够解决此问题。不过,我不确定为什么会起作用。
public static T GetById<T>(this IQueryable<T> collection, Guid id) where T : class, IEntity{ //...}