-
Notifications
You must be signed in to change notification settings - Fork 7
/
Examples.cs
57 lines (45 loc) · 1.34 KB
/
Examples.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations;
using MyApplication;
namespace RazorBlade.IntegrationTest.Examples
{
[SuppressMessage("ReSharper", "UnusedVariable")]
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
internal class Examples
{
public static void ExampleTemplateUsage()
{
#region ExampleTemplate.Usage
var template = new ExampleTemplate
{
Name = "World"
};
var result = template.Render();
#endregion
}
public static void TemplateWithModelUsage()
{
#region TemplateWithModel.Usage
var model = new GreetingModel { Name = "World" };
var template = new TemplateWithModel(model);
var result = template.Render();
#endregion
}
public static void TemplateWithManualModelUsage()
{
#region TemplateWithManualModel.Usage
var model = new GreetingModel { Name = "World" };
var template = new TemplateWithManualModel { Model = model };
var result = template.Render();
#endregion
}
}
}
namespace MyApplication
{
public class GreetingModel
{
public required string Name { get; init; }
}
public class ModelType;
}