Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard docs about if the disposable is created or cached #118

Open
JohanLarsson opened this issue Oct 16, 2018 · 0 comments
Open

Standard docs about if the disposable is created or cached #118

JohanLarsson opened this issue Oct 16, 2018 · 0 comments

Comments

@JohanLarsson
Copy link
Collaborator

namespace RoslynSandbox
{
    using System;

    public static class Foo
    {
        /// <summary>
        /// ...
        /// </summary>
        /// <returns>A new instance of <see cref="Disposable"/> that the caller is responsible for disposing.</returns>
        public static IDisposable Create() => new Disposable();
    }
}

And

namespace RoslynSandbox
{
    using System;

    public static class Foo
    {
        private static readonly IDisposable Instance = new Disposable();

        /// <summary>
        /// ...
        /// </summary>
        /// <returns>A cached instance of <see cref="Disposable"/> that the caller must not dispose.</returns>
        public static IDisposable Bar() => Instance;
    }
}
@JohanLarsson JohanLarsson changed the title Starndard docs about if the disposable is created or cached Standard docs about if the disposable is created or cached Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant