单例模式 - 简化实现?

Pet*_*r T 8 c# resharper singleton

在深度C#中建议的单例模式实现是

public sealed class Singleton
{
    private static readonly Singleton instance = new Singleton();
    static Singleton()
    {
    }

    private Singleton()
    {
    }

    public static Singleton Instance
    {
        get
        {
            return instance;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

ReSharper建议使用auto属性和C#6自动属性初始化器简化它:

public sealed class Singleton
{
    static Singleton()
    {
    }

    private Singleton()
    {
    }

    public static Singleton Instance { get; } = new Singleton();
}
Run Code Online (Sandbox Code Playgroud)

这确实看起来更简单.使用这种简化有不足之处吗?

BWA*_*BWA 2

在网站https://sharplab.io上您可以查看 IL 代码,两种情况下的 IL 代码都是相似的。所以这应该以同样的方式工作。