-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3992
- Loading branch information
Showing
35 changed files
with
4,110 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...erator/Microsoft.Generator.CSharp.ClientModel/src/Snippets/BinaryContentHelperSnippets.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.ClientModel; | ||
using Microsoft.Generator.CSharp.ClientModel.Providers; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
using static Microsoft.Generator.CSharp.Snippets.Snippet; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Snippets | ||
{ | ||
internal static class BinaryContentHelperSnippets | ||
{ | ||
public static ScopedApi<BinaryContent> FromEnumerable(ValueExpression body) | ||
=> Static<BinaryContentHelperDefinition>().Invoke("FromEnumerable", body).As<BinaryContent>(); | ||
|
||
public static ScopedApi<BinaryContent> FromReadOnlyMemory(ValueExpression body) | ||
=> Static<BinaryContentHelperDefinition>().Invoke("FromReadOnlyMemory", body).As<BinaryContent>(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ator/Microsoft.Generator.CSharp.ClientModel/src/Snippets/JsonSerializerOptionsSnippets.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using Microsoft.Generator.CSharp.Expressions; | ||
using Microsoft.Generator.CSharp.Snippets; | ||
using Microsoft.Generator.CSharp.Statements; | ||
|
||
namespace Microsoft.Generator.CSharp.ClientModel.Snippets | ||
{ | ||
internal static class JsonSerializerOptionsSnippets | ||
{ | ||
public static MethodBodyStatement AddConverter(this ScopedApi<JsonSerializerOptions> options, ValueExpression converter) | ||
=> options.Property(nameof(JsonSerializerOptions.Converters)).Invoke(nameof(IList<object>.Add), converter).Terminate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.