namespace Admin.NET.Core;
///
/// 动态作业编译
///
public class DynamicJobCompiler : ISingleton
{
///
/// 编译代码并返回其中实现 IJob 的类型
///
/// 动态编译的作业代码
///
public Type BuildJob(string script)
{
var jobAssembly = Schedular.CompileCSharpClassCode(script);
var jobType = jobAssembly.GetTypes().FirstOrDefault(u => typeof(IJob).IsAssignableFrom(u));
return jobType;
}
}