99
1010namespace SampleTypeSpec
1111{
12- /// <summary> The ImplicitDynamicModel . </summary>
13- public partial class ImplicitDynamicModel : IJsonModel < ImplicitDynamicModel >
12+ /// <summary> The BaseModel . </summary>
13+ public partial class BaseModel : IJsonModel < BaseModel >
1414 {
15- /// <summary> Initializes a new instance of <see cref="ImplicitDynamicModel "/> for deserialization. </summary>
16- internal ImplicitDynamicModel ( )
15+ /// <summary> Initializes a new instance of <see cref="BaseModel "/> for deserialization. </summary>
16+ internal BaseModel ( )
1717 {
1818 }
1919
2020 /// <param name="writer"> The JSON writer. </param>
2121 /// <param name="options"> The client options for reading and writing models. </param>
22- void IJsonModel < ImplicitDynamicModel > . Write ( Utf8JsonWriter writer , ModelReaderWriterOptions options )
22+ void IJsonModel < BaseModel > . Write ( Utf8JsonWriter writer , ModelReaderWriterOptions options )
2323 {
2424 writer . WriteStartObject ( ) ;
2525 JsonModelWriteCore ( writer , options ) ;
@@ -30,10 +30,10 @@ void IJsonModel<ImplicitDynamicModel>.Write(Utf8JsonWriter writer, ModelReaderWr
3030 /// <param name="options"> The client options for reading and writing models. </param>
3131 protected virtual void JsonModelWriteCore ( Utf8JsonWriter writer , ModelReaderWriterOptions options )
3232 {
33- string format = options . Format == "W" ? ( ( IPersistableModel < ImplicitDynamicModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
33+ string format = options . Format == "W" ? ( ( IPersistableModel < BaseModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
3434 if ( format != "J" )
3535 {
36- throw new FormatException ( $ "The model { nameof ( ImplicitDynamicModel ) } does not support writing '{ format } ' format.") ;
36+ throw new FormatException ( $ "The model { nameof ( BaseModel ) } does not support writing '{ format } ' format.") ;
3737 }
3838 writer . WritePropertyName ( "name"u8 ) ;
3939 writer . WriteStringValue ( Name ) ;
@@ -56,24 +56,24 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
5656
5757 /// <param name="reader"> The JSON reader. </param>
5858 /// <param name="options"> The client options for reading and writing models. </param>
59- ImplicitDynamicModel IJsonModel < ImplicitDynamicModel > . Create ( ref Utf8JsonReader reader , ModelReaderWriterOptions options ) => JsonModelCreateCore ( ref reader , options ) ;
59+ BaseModel IJsonModel < BaseModel > . Create ( ref Utf8JsonReader reader , ModelReaderWriterOptions options ) => JsonModelCreateCore ( ref reader , options ) ;
6060
6161 /// <param name="reader"> The JSON reader. </param>
6262 /// <param name="options"> The client options for reading and writing models. </param>
63- protected virtual ImplicitDynamicModel JsonModelCreateCore ( ref Utf8JsonReader reader , ModelReaderWriterOptions options )
63+ protected virtual BaseModel JsonModelCreateCore ( ref Utf8JsonReader reader , ModelReaderWriterOptions options )
6464 {
65- string format = options . Format == "W" ? ( ( IPersistableModel < ImplicitDynamicModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
65+ string format = options . Format == "W" ? ( ( IPersistableModel < BaseModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
6666 if ( format != "J" )
6767 {
68- throw new FormatException ( $ "The model { nameof ( ImplicitDynamicModel ) } does not support reading '{ format } ' format.") ;
68+ throw new FormatException ( $ "The model { nameof ( BaseModel ) } does not support reading '{ format } ' format.") ;
6969 }
7070 using JsonDocument document = JsonDocument . ParseValue ( ref reader ) ;
71- return DeserializeImplicitDynamicModel ( document . RootElement , options ) ;
71+ return DeserializeBaseModel ( document . RootElement , options ) ;
7272 }
7373
7474 /// <param name="element"> The JSON element to deserialize. </param>
7575 /// <param name="options"> The client options for reading and writing models. </param>
76- internal static ImplicitDynamicModel DeserializeImplicitDynamicModel ( JsonElement element , ModelReaderWriterOptions options )
76+ internal static BaseModel DeserializeBaseModel ( JsonElement element , ModelReaderWriterOptions options )
7777 {
7878 if ( element . ValueKind == JsonValueKind . Null )
7979 {
@@ -93,47 +93,47 @@ internal static ImplicitDynamicModel DeserializeImplicitDynamicModel(JsonElement
9393 additionalBinaryDataProperties . Add ( prop . Name , BinaryData . FromString ( prop . Value . GetRawText ( ) ) ) ;
9494 }
9595 }
96- return new ImplicitDynamicModel ( name , additionalBinaryDataProperties ) ;
96+ return new BaseModel ( name , additionalBinaryDataProperties ) ;
9797 }
9898
9999 /// <param name="options"> The client options for reading and writing models. </param>
100- BinaryData IPersistableModel < ImplicitDynamicModel > . Write ( ModelReaderWriterOptions options ) => PersistableModelWriteCore ( options ) ;
100+ BinaryData IPersistableModel < BaseModel > . Write ( ModelReaderWriterOptions options ) => PersistableModelWriteCore ( options ) ;
101101
102102 /// <param name="options"> The client options for reading and writing models. </param>
103103 protected virtual BinaryData PersistableModelWriteCore ( ModelReaderWriterOptions options )
104104 {
105- string format = options . Format == "W" ? ( ( IPersistableModel < ImplicitDynamicModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
105+ string format = options . Format == "W" ? ( ( IPersistableModel < BaseModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
106106 switch ( format )
107107 {
108108 case "J" :
109109 return ModelReaderWriter . Write ( this , options , SampleTypeSpecContext . Default ) ;
110110 default :
111- throw new FormatException ( $ "The model { nameof ( ImplicitDynamicModel ) } does not support writing '{ options . Format } ' format.") ;
111+ throw new FormatException ( $ "The model { nameof ( BaseModel ) } does not support writing '{ options . Format } ' format.") ;
112112 }
113113 }
114114
115115 /// <param name="data"> The data to parse. </param>
116116 /// <param name="options"> The client options for reading and writing models. </param>
117- ImplicitDynamicModel IPersistableModel < ImplicitDynamicModel > . Create ( BinaryData data , ModelReaderWriterOptions options ) => PersistableModelCreateCore ( data , options ) ;
117+ BaseModel IPersistableModel < BaseModel > . Create ( BinaryData data , ModelReaderWriterOptions options ) => PersistableModelCreateCore ( data , options ) ;
118118
119119 /// <param name="data"> The data to parse. </param>
120120 /// <param name="options"> The client options for reading and writing models. </param>
121- protected virtual ImplicitDynamicModel PersistableModelCreateCore ( BinaryData data , ModelReaderWriterOptions options )
121+ protected virtual BaseModel PersistableModelCreateCore ( BinaryData data , ModelReaderWriterOptions options )
122122 {
123- string format = options . Format == "W" ? ( ( IPersistableModel < ImplicitDynamicModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
123+ string format = options . Format == "W" ? ( ( IPersistableModel < BaseModel > ) this ) . GetFormatFromOptions ( options ) : options . Format ;
124124 switch ( format )
125125 {
126126 case "J" :
127127 using ( JsonDocument document = JsonDocument . Parse ( data ) )
128128 {
129- return DeserializeImplicitDynamicModel ( document . RootElement , options ) ;
129+ return DeserializeBaseModel ( document . RootElement , options ) ;
130130 }
131131 default :
132- throw new FormatException ( $ "The model { nameof ( ImplicitDynamicModel ) } does not support reading '{ options . Format } ' format.") ;
132+ throw new FormatException ( $ "The model { nameof ( BaseModel ) } does not support reading '{ options . Format } ' format.") ;
133133 }
134134 }
135135
136136 /// <param name="options"> The client options for reading and writing models. </param>
137- string IPersistableModel < ImplicitDynamicModel > . GetFormatFromOptions ( ModelReaderWriterOptions options ) => "J" ;
137+ string IPersistableModel < BaseModel > . GetFormatFromOptions ( ModelReaderWriterOptions options ) => "J" ;
138138 }
139139}
0 commit comments