Skip to content

UninitializedDbSetDiagnosticSuppressor doesn't work when a constructor is present #26879

Closed

Description

@roji

#21608 introduced a DiagnosticsSuppressor to suppress CS8618 (non-nullable property is uninitialized) for DbSet properties on DbContexts. This currently works fine as long as there is no constructor on the DbContext, but fails if a constructor is defined, since the diagnostic is reported on the constructor declaration, and not on the property.

Roslyn issue: dotnet/roslyn#58073

Activity

  1. self-assigned this
    on Dec 2, 2021
  2. added this to the 7.0.0 milestone on Dec 9, 2021
  3. roji commented on Jan 29, 2022

    @roji
    MemberAuthor

    Roslyn-side issue has been fixed - this should be unblocked in preview3.

  4. added 2 commits that reference this issue on Apr 22, 2022
    4f326a5
    4890196
  5. added a commit that references this issue on Apr 26, 2022
    2858513
  6. modified the milestones: 7.0.0, on May 4, 2022
  7. modified the milestones: , 7.0.0 on Nov 5, 2022
  8. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions