public virtual object GetDetailPage(PageDataOptions pageData)
{
Type detailType = typeof(T).GetCustomAttribute<EntityAttribute>()?.DetailTable?[0];
if (detailType == null)
{
return null;
}
object obj = typeof(ServiceBase<T, TRepository>)
.GetMethod("GetDetailPage", BindingFlags.Instance | BindingFlags.NonPublic)
.MakeGenericMethod(new Type[] { detailType }).Invoke(this, new object[] { pageData });
return obj;
}
很不错的用法!