我正在尝试在我的 asp core 2.0 项目中使用 Quartz sheduker。我使用 nuget 下载了 Quartz 3.0.4,之后添加了 services.AddQuartz(new QuartezOptions {}); Startup.cs中的ConfigureService函数
我对 app.UseQuartz() 也有同样的问题
这就是 Startup.cs 现在的样子:
using AspProj.Map;
using Microsoft.Extensions.Configuration;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Swashbuckle.AspNetCore.Swagger;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Quartz;
namespace AspProj
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public …Run Code Online (Sandbox Code Playgroud) 为什么这段代码打印错误?
class Program
{
public static void OpTest<T>(T s, T t) where T : class
{
Console.WriteLine(s == t);
}
static void Main()
{
string s1 = "string";
System.Text.StringBuilder sb = new System.Text.StringBuilder(s1);
string s2 = sb.ToString();
OpTest(s1, s2);
}
}
Run Code Online (Sandbox Code Playgroud)
我是否正确理解,相比之下,它们不是作为字符串进行比较,而是作为对象进行比较,这就是为什么不比较它们的值,而是它们指向的地址?