Skip to content

Commit 9836792

Browse files
authored
Merge pull request #8 from geeklearningio/master
Master
2 parents 3a30982 + 106861b commit 9836792

File tree

13 files changed

+95
-51
lines changed

13 files changed

+95
-51
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/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}}

samples/GeekLearning.Templating.BasicSample/project.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
11
{
22
"dependencies": {
33
"Microsoft.NETCore.App": {
4-
"version": "1.0.0-rc2-3002702",
4+
"version": "1.0.0",
55
"type": "platform"
66
},
7-
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
8-
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
9-
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
10-
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
11-
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
12-
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
13-
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final",
14-
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
15-
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
16-
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
17-
"GeekLearning.Storage.FileSystem": "0.2.0",
18-
"GeekLearning.Storage.Azure": "0.2.0",
7+
"Microsoft.AspNetCore.Mvc": "1.0.0",
8+
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
9+
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
10+
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
11+
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
12+
"Microsoft.Extensions.Configuration.Json": "1.0.0",
13+
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
14+
"Microsoft.Extensions.Logging": "1.0.0",
15+
"Microsoft.Extensions.Logging.Console": "1.0.0",
16+
"Microsoft.Extensions.Logging.Debug": "1.0.0",
17+
"GeekLearning.Storage.FileSystem": "0.3.0-*",
18+
"GeekLearning.Storage.Azure": "0.3.0-*",
1919
"GeekLearning.Templating": "*",
2020
"GeekLearning.Templating.Handlebars": "*",
2121
"GeekLearning.Templating.Mustache": "*"
2222
},
2323

2424
"tools": {
25-
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
26-
"version": "1.0.0-preview1-final",
27-
"imports": "portable-net45+win8+dnxcore50"
28-
}
25+
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
2926
},
3027

3128
"frameworks": {
3229
"netcoreapp1.0": {
3330
"imports": [
3431
"dotnet5.6",
35-
"dnxcore50",
3632
"portable-net45+win8"
3733
]
3834
}
@@ -44,7 +40,9 @@
4440
},
4541

4642
"runtimeOptions": {
47-
"gcServer": true
43+
"configProperties": {
44+
"System.GC.Server": true
45+
}
4846
},
4947

5048
"publishOptions": {

src/GeekLearning.Templating.Handlebars/project.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
},
1010

1111
"dependencies": {
12-
"NETStandard.Library": "1.5.0-rc2-24027",
13-
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc2-final",
14-
"handlebars.netstandard": "1.0.0-dotnet-core-rc2-0001",
12+
"NETStandard.Library": "1.6.0",
13+
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0",
14+
"Handlebars.NetStandard": "1.0.0-dotnet-core-rtm1",
1515
"GeekLearning.Templating": "*"
1616
},
1717

@@ -20,7 +20,6 @@
2020
"netstandard1.5": {
2121
"imports": [
2222
"dotnet5.6",
23-
"dnxcore50",
2423
"portable-net45+win8"
2524
]
2625
}

0 commit comments

Comments
 (0)