-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ModelReaderWriterOptions.cs
36 lines (31 loc) · 1.17 KB
/
ModelReaderWriterOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace System.ClientModel.Primitives;
/// <summary>
/// Provides the client options for reading and writing models.
/// </summary>
public class ModelReaderWriterOptions
{
private static ModelReaderWriterOptions? s_jsonOptions;
/// <summary>
/// Default options for writing models into JSON format.
/// </summary>
public static ModelReaderWriterOptions Json => s_jsonOptions ??= new ModelReaderWriterOptions("J");
private static ModelReaderWriterOptions? s_xmlOptions;
/// <summary>
/// Default options for writing models into XML format.
/// </summary>
public static ModelReaderWriterOptions Xml => s_xmlOptions ??= new ModelReaderWriterOptions("X");
/// <summary>
/// Initializes a new instance of <see cref="ModelReaderWriterOptions"/>.
/// </summary>
/// <param name="format">The format to read and write models.</param>
public ModelReaderWriterOptions (string format)
{
Format = format;
}
/// <summary>
/// Gets the format to read and write the model.
/// </summary>
public string Format { get; }
}