-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[http-client-csharp] Fix: allow suppressing & replacing fields (#4795)
This PR enables the suppression of fields via the `CodeGenSuppress` attribute, and enables the replacement of fields via custom code. fixes: #4792
- Loading branch information
1 parent
48d7bc0
commit a8c67ff
Showing
8 changed files
with
148 additions
and
11 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
12 changes: 12 additions & 0 deletions
12
.../TestData/ClientProviderCustomizationTests/CanRemoveCachingField/CanRemoveCachingField.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,12 @@ | ||
|
||
using System; | ||
using Microsoft.Generator.CSharp.Customization; | ||
|
||
namespace Sample | ||
{ | ||
[CodeGenSuppress("_cachedDog")] | ||
public partial class TestClient | ||
{ | ||
|
||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...roviders/ModelProviders/TestData/ModelCustomizationTests/CanRemoveField/MockInputModel.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,8 @@ | ||
using Microsoft.Generator.CSharp.Customization; | ||
|
||
namespace Sample.Models; | ||
|
||
[CodeGenSuppress("_additionalBinaryDataProperties")] | ||
public partial class MockInputModel | ||
{ | ||
} |
14 changes: 14 additions & 0 deletions
14
...oviders/ModelProviders/TestData/ModelCustomizationTests/CanReplaceField/MockInputModel.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,14 @@ | ||
#nullable disable | ||
|
||
using Sample; | ||
using System.ClientModel; | ||
using System.ClientModel.Primitives; | ||
using Microsoft.Generator.CSharp.Customization; | ||
|
||
namespace Sample.Models | ||
{ | ||
public partial class MockInputModel | ||
{ | ||
private BinaryData _additionalBinaryDataProperties; | ||
} | ||
} |