using System; using System.Threading.Tasks; namespace NCC.ViewEngine { /// /// 视图引擎接口 /// public interface IViewEngine { /// /// 编译并运行 /// /// /// /// /// string RunCompile(string content, object model = null, Action builderAction = null); /// /// 编译并运行 /// /// /// /// /// Task RunCompileAsync(string content, object model = null, Action builderAction = null); /// /// 编译并运行 /// /// /// /// /// /// string RunCompile(string content, T model, Action builderAction = null) where T : class, new(); /// /// 编译并运行 /// /// /// /// /// /// Task RunCompileAsync(string content, T model, Action builderAction = null) where T : class, new(); /// /// 通过缓存解析模板 /// /// /// /// /// /// string RunCompileFromCached(string content, object model = null, string cacheFileName = default, Action builderAction = null); /// /// 通过缓存解析模板 /// /// /// /// /// /// Task RunCompileFromCachedAsync(string content, object model = null, string cacheFileName = default, Action builderAction = null); /// /// 通过缓存解析模板 /// /// /// /// /// /// /// string RunCompileFromCached(string content, T model, string cacheFileName = default, Action builderAction = null) where T : class, new(); /// /// 通过缓存解析模板 /// /// /// /// /// /// Task RunCompileFromCachedAsync(string content, T model, string cacheFileName = default, Action builderAction = null) where T : class, new(); /// /// 编译模板 /// /// /// /// IViewEngineTemplate Compile(string content, Action builderAction = null); /// /// 编译模板 /// /// /// /// Task CompileAsync(string content, Action builderAction = null); /// /// 编译模板 /// /// /// /// /// IViewEngineTemplate Compile(string content, Action builderAction = null) where T : IViewEngineModel; /// /// 编译模板 /// /// /// /// /// Task> CompileAsync(string content, Action builderAction = null) where T : IViewEngineModel; } }