-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee98488
commit 84859cb
Showing
11 changed files
with
127 additions
and
18 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 @@ | ||
@inherits RazorBlade.HtmlTemplate |
1 change: 1 addition & 0 deletions
1
src/RazorBlade.IntegrationTest/Examples/EmptyTemplateWithModel.cshtml
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 @@ | ||
@inherits RazorBlade.HtmlTemplate<MyApplication.ModelType> |
8 changes: 8 additions & 0 deletions
8
src/RazorBlade.IntegrationTest/Examples/ExampleTemplate.cshtml
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,8 @@ | ||
@inherits RazorBlade.HtmlTemplate | ||
|
||
Hello, <i>@Name</i>! | ||
|
||
@functions | ||
{ | ||
public string? Name { get; init; } | ||
} |
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,46 @@ | ||
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 | ||
} | ||
} | ||
} | ||
|
||
namespace MyApplication | ||
{ | ||
public class GreetingModel | ||
{ | ||
public required string Name { get; init; } | ||
} | ||
|
||
public class ModelType; | ||
} |
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,3 @@ | ||
@inherits RazorBlade.HtmlLayout | ||
|
||
@RenderBody() |
6 changes: 6 additions & 0 deletions
6
src/RazorBlade.IntegrationTest/Examples/TemplateWithLayout.cshtml
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,6 @@ | ||
@inherits RazorBlade.HtmlTemplate | ||
@* begin-snippet: TemplateWithLayout.Usage *@ | ||
@{ | ||
Layout = new LayoutToUse(); | ||
} | ||
@* end-snippet *@ |
4 changes: 4 additions & 0 deletions
4
src/RazorBlade.IntegrationTest/Examples/TemplateWithModel.cshtml
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,4 @@ | ||
@using MyApplication | ||
@inherits RazorBlade.HtmlTemplate<GreetingModel> | ||
|
||
Hello, <i>@Model.Name</i>! |
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
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,7 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/schema.json", | ||
"Convention": "InPlaceOverwrite", | ||
"ExcludeDirectories": [ | ||
"lib" | ||
] | ||
} |