Skip to content

Commit 23697db

Browse files
committed
Make the As{UnionCaseName} extension methods available to .NET Standard 2.0 and below
type: feature scope: generated-graphql
1 parent 8dbc0da commit 23697db

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

ShopifySharp.GraphQL.Parser/Writer.fs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -549,17 +549,10 @@ let private writeUnionCaseWrappers unionTypeName (unionTypeCases: string[]) (wri
549549
/// </summary>
550550
let private writeUnionTypeConversionMethods unionTypeName (unionCaseNames: string[]) writer: ValueTask =
551551
pipeWriter writer {
552-
// These default interface methods are only usable in .NET 6.0 and above - anything lower will cause
553-
// the compiler to throw an error.
554-
do! "#if NET6_0_OR_GREATER"
555-
do! NewLine
556-
557552
for unionCaseName in unionCaseNames do
558553
let caseWrapperName = toUnionCaseWrapperName unionTypeName unionCaseName
559554
do! (toTab Indented) + $"public {unionCaseName}? As{unionCaseName}() => this is {caseWrapperName} wrapper ? wrapper.Value : null;"
560555
do! NewLine
561-
562-
do! "#endif"
563556
}
564557

565558
let private writeUnionType (unionType: UnionType) (_: IParsedContext) (writer: Writer): ValueTask =

0 commit comments

Comments
 (0)