-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathJsonByExampleTemplate.sbntxt
More file actions
34 lines (34 loc) · 1.5 KB
/
JsonByExampleTemplate.sbntxt
File metadata and controls
34 lines (34 loc) · 1.5 KB
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
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:{{ RuntimeVersion }}
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable disable
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;{{ for OptionalDependency in OptionalDependencies}}
using {{ OptionalDependency }};
{{ end }}
namespace {{ NamespaceName }}
{
{{ for ClassModel in ClassModels }}
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("{{ ToolName }}", "{{ ToolVersion }}")]
[DataContract(Name = "{{ ClassModel.ClassName }}", Namespace = "{{ NamespaceName }}")]
public partial class {{ ClassModel.ClassName }}
{
{{ for Property in ClassModel.Properties }}[DataMember(Name = "{{ Property.PropertyNameOriginal }}", EmitDefaultValue = false, Order = {{ Property.Order }})]
public {{ Property.PropertyType }} {{ Property.PropertyName }} { get; set; }
{{ end }}{{ if ConfigEnabled }}
public static {{ ClassModel.ClassName }} FromConfig([System.Diagnostics.CodeAnalysis.NotNull] IConfiguration config)
{
return config.Get<{{ ClassModel.ClassName }}>();
}{{ end }}
}
{{ end }}
}
#nullable enable