Skip to content

Commit 106861b

Browse files
authored
Merge pull request #7 from geeklearningio/release/0.3.0
Release/0.3.0
2 parents 258792a + d150c9a commit 106861b

File tree

23 files changed

+194
-50
lines changed

23 files changed

+194
-50
lines changed

GeekLearning.Templating.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Templating", "src\GeekLearning.Templating\GeekLearning.Templating.xproj", "{369E8A80-AC62-4F8E-9CE3-AE5E6A35925E}"
77
EndProject
@@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1919
ProjectSection(SolutionItems) = preProject
2020
.gitattributes = .gitattributes
2121
.gitignore = .gitignore
22+
GitVersion.yml = GitVersion.yml
2223
global.json = global.json
2324
LICENSE.md = LICENSE.md
2425
README.md = README.md

GitVersion.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
branches:
2+
dev(elop)?(ment)?$:
3+
tag: alpha
4+
features?[/-]:
5+
tag: alpha.{BranchName}
6+
releases?[/-]:
7+
mode: ContinuousDeployment
8+
hotfix(es)?[/-]:
9+
mode: ContinuousDeployment

global.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"projects": [ "src", "samples" ],
3-
"sdk": {
4-
"version": "1.0.0-preview1-002702"
5-
}
3+
"sdk": { "version": "1.0.0-preview2-003121" }
64
}

samples/GeekLearning.Templating.BasicSample/Controllers/TestController.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public TestController(EmailTemplates templates)
1818

1919
// POST api/values
2020
[HttpGet]
21-
public async Task<string> Post([FromQuery]InvitationContext value)
21+
public async Task<string> Get([FromQuery]InvitationContext value)
2222
{
2323
try
2424
{
@@ -32,7 +32,7 @@ public async Task<string> Post([FromQuery]InvitationContext value)
3232

3333
// POST api/values
3434
[HttpGet("2")]
35-
public async Task<string> Post2([FromQuery]InvitationContext value)
35+
public async Task<string> Get2([FromQuery]InvitationContext value)
3636
{
3737
try
3838
{
@@ -43,5 +43,18 @@ public async Task<string> Post2([FromQuery]InvitationContext value)
4343
return ice.InnerException.Message;
4444
}
4545
}
46+
47+
[HttpGet("3")]
48+
public async Task<string> Get3([FromQuery]InvitationContext value)
49+
{
50+
try
51+
{
52+
return await templates.ApplyInvitation3Template(value);
53+
}
54+
catch (InvalidContextException ice)
55+
{
56+
return ice.InnerException.Message;
57+
}
58+
}
4659
}
4760
}

samples/GeekLearning.Templating.BasicSample/EmailTemplates.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@ public Task<string> ApplyInvitation2Template(InvitationContext context)
2222
{
2323
return this.LoadAndApplyTemplate("invitation2", context);
2424
}
25+
26+
public Task<string> ApplyInvitation3Template(InvitationContext context)
27+
{
28+
return this.LoadAndApplyTemplate("SubDir/invitation", context);
29+
}
2530
}
2631
}

samples/GeekLearning.Templating.BasicSample/InvitationContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ public class InvitationContext
1010
public string UserName { get; set; }
1111

1212
public string Something { get; set; }
13+
14+
public string Origin { get; set; }
1315
}
1416
}

samples/GeekLearning.Templating.BasicSample/Startup.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ public Startup(IHostingEnvironment env)
1717
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
1818
.AddEnvironmentVariables();
1919
Configuration = builder.Build();
20+
this.HostingEnvironment = env;
2021
}
2122

2223
public IConfigurationRoot Configuration { get; }
24+
public IHostingEnvironment HostingEnvironment { get; }
2325

2426
// This method gets called by the runtime. Use this method to add services to the container.
2527
public void ConfigureServices(IServiceCollection services)
2628
{
2729
// Add framework services.
2830
services.AddMvc();
2931
services.AddMemoryCache();
30-
services.AddStorage().AddFileSystemStorage().AddAzureStorage();
32+
services.AddStorage().AddFileSystemStorage(HostingEnvironment.ContentRootPath).AddAzureStorage();
3133
services.Configure<StorageOptions>(Configuration.GetSection("Storage"));
3234
services.AddTemplating().AddMustache().AddHandlebars();
3335

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--
2+
This is a more Awesome footer{{#if Origin}} (Copyright : {{Origin}}){{/if}}.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Hi {{UserName}},
2+
3+
This is another invitation to {{Something}}.
4+
5+
{{> footer}}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--
2+
This is an Awesome footer{{#if Origin}} (Copyright : {{Origin}}){{/if}}.

0 commit comments

Comments
 (0)