Skip to content

Compiler warnings in a #nullable enable context #1560

Description

@gcatanese

medium

The removal of the parameterized constructor leaves the non-nullable properties MerchantAccount and SetupToken uninitialized. In a #nullable enable context, this will generate compiler warnings (CS8618). Since these are required fields, they should be initialized to avoid a null state.

        public CreateSessionRequest()
        {
            MerchantAccount = default!;
            SetupToken = default!;
            OnCreated();
        }

Originally posted by @gemini-code-assist[bot] in #1558 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions