请考虑以下几点:
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bll {
public static class Extensions {
public static IQueryable<Sys.EntityModels.BfxProject> CompleteProject( this Sys.EntityModels.BfxEntities context ) {
return context.BfxProjects
.Include( x => x.BfxFiles.Select( f => f.BfxSecurity ) );
}
}
}
BfxProjects 可以有嵌套的 BfxProjects。我希望 CompleteProject 扩展方法递归地返回甚至任何嵌套的 BfxProjects。我该如何做到这一点?