forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ClientModel: Reshuffle some whitespace and files for consistency acro…
…ss ClientModel (Azure#41425) * Initial implementation of SetHeader * Add tests for SetHeader * more tests * updates * Reshuffle a bit for consistency across ClientModel files * remove SetHeader changes that will be part of a separate PR * nits * Add .editorconfig * remove most NoWarn suppressions from .csproj
- Loading branch information
1 parent
7f7ee04
commit f628c98
Showing
51 changed files
with
1,481 additions
and
1,380 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[/**.cs] | ||
csharp_style_namespace_declarations = file_scoped:error |
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
55 changes: 27 additions & 28 deletions
55
sdk/core/System.ClientModel/src/ModelReaderWriter/IPersistableModel.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 |
---|---|---|
@@ -1,37 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
namespace System.ClientModel.Primitives | ||
namespace System.ClientModel.Primitives; | ||
|
||
/// <summary> | ||
/// Allows an object to control its own writing and reading. | ||
/// The format is determined by the implementer. | ||
/// </summary> | ||
/// <typeparam name="T">The type the model can be converted into.</typeparam> | ||
public interface IPersistableModel<out T> | ||
{ | ||
/// <summary> | ||
/// Allows an object to control its own writing and reading. | ||
/// The format is determined by the implementer. | ||
/// Writes the model into a <see cref="BinaryData"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The type the model can be converted into.</typeparam> | ||
public interface IPersistableModel<out T> | ||
{ | ||
/// <summary> | ||
/// Writes the model into a <see cref="BinaryData"/>. | ||
/// </summary> | ||
/// <param name="options">The <see cref="ModelReaderWriterOptions"/> to use.</param> | ||
/// <returns>A binary representation of the written model.</returns> | ||
/// <exception cref="FormatException">If the model does not support the requested <see cref="ModelReaderWriterOptions.Format"/>.</exception> | ||
BinaryData Write(ModelReaderWriterOptions options); | ||
/// <param name="options">The <see cref="ModelReaderWriterOptions"/> to use.</param> | ||
/// <returns>A binary representation of the written model.</returns> | ||
/// <exception cref="FormatException">If the model does not support the requested <see cref="ModelReaderWriterOptions.Format"/>.</exception> | ||
BinaryData Write(ModelReaderWriterOptions options); | ||
|
||
/// <summary> | ||
/// Converts the provided <see cref="BinaryData"/> into a model. | ||
/// </summary> | ||
/// <param name="data">The <see cref="BinaryData"/> to parse.</param> | ||
/// <param name="options">The <see cref="ModelReaderWriterOptions"/> to use.</param> | ||
/// <returns>A <typeparamref name="T"/> representation of the data.</returns> | ||
/// <exception cref="FormatException">If the model does not support the requested <see cref="ModelReaderWriterOptions.Format"/>.</exception> | ||
T Create(BinaryData data, ModelReaderWriterOptions options); | ||
/// <summary> | ||
/// Converts the provided <see cref="BinaryData"/> into a model. | ||
/// </summary> | ||
/// <param name="data">The <see cref="BinaryData"/> to parse.</param> | ||
/// <param name="options">The <see cref="ModelReaderWriterOptions"/> to use.</param> | ||
/// <returns>A <typeparamref name="T"/> representation of the data.</returns> | ||
/// <exception cref="FormatException">If the model does not support the requested <see cref="ModelReaderWriterOptions.Format"/>.</exception> | ||
T Create(BinaryData data, ModelReaderWriterOptions options); | ||
|
||
/// <summary> | ||
/// Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service. | ||
/// <param name="options">The <see cref="ModelReaderWriterOptions"/> to use.</param> | ||
/// </summary> | ||
/// <returns>The format that the model uses when communicating with the serivce.</returns> | ||
string GetFormatFromOptions(ModelReaderWriterOptions options); | ||
} | ||
/// <summary> | ||
/// Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service. | ||
/// <param name="options">The <see cref="ModelReaderWriterOptions"/> to use.</param> | ||
/// </summary> | ||
/// <returns>The format that the model uses when communicating with the serivce.</returns> | ||
string GetFormatFromOptions(ModelReaderWriterOptions options); | ||
} |
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.