Skip to content

Commit 258792a

Browse files
authored
Merge pull request #4 from geeklearningio/release/0.2.0
Release/0.2.0
2 parents f8a43ff + 962fe17 commit 258792a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+357
-360
lines changed

GeekLearning.Templating.sln

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@ VisualStudioVersion = 14.0.25123.0
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
8-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Templating.BasicSample", "src\GeekLearning.Templating.BasicSample\GeekLearning.Templating.BasicSample.xproj", "{45A8B12E-ED81-4D4B-A784-23DB221EBA6F}"
8+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Templating.BasicSample", "samples\GeekLearning.Templating.BasicSample\GeekLearning.Templating.BasicSample.xproj", "{45A8B12E-ED81-4D4B-A784-23DB221EBA6F}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E0BAC0FB-2A34-4E10-A2D2-4E587E50A47A}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{432F4069-691C-498A-8017-81E41CBF0CCD}"
13+
EndProject
14+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Templating.Handlebars", "src\GeekLearning.Templating.Handlebars\GeekLearning.Templating.Handlebars.xproj", "{E72256FA-DFF3-4487-AA94-E6D5BD1BDD2D}"
15+
EndProject
16+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GeekLearning.Templating.Mustache", "src\GeekLearning.Templating.Mustache\GeekLearning.Templating.Mustache.xproj", "{515925E3-4359-4079-A24C-E7367560C95F}"
17+
EndProject
18+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A75429E6-34A4-43EC-AA7E-6DD4FFAF8704}"
19+
ProjectSection(SolutionItems) = preProject
20+
.gitattributes = .gitattributes
21+
.gitignore = .gitignore
22+
global.json = global.json
23+
LICENSE.md = LICENSE.md
24+
README.md = README.md
25+
EndProjectSection
926
EndProject
1027
Global
1128
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -21,8 +38,22 @@ Global
2138
{45A8B12E-ED81-4D4B-A784-23DB221EBA6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
2239
{45A8B12E-ED81-4D4B-A784-23DB221EBA6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
2340
{45A8B12E-ED81-4D4B-A784-23DB221EBA6F}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{E72256FA-DFF3-4487-AA94-E6D5BD1BDD2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{E72256FA-DFF3-4487-AA94-E6D5BD1BDD2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{E72256FA-DFF3-4487-AA94-E6D5BD1BDD2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{E72256FA-DFF3-4487-AA94-E6D5BD1BDD2D}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{515925E3-4359-4079-A24C-E7367560C95F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{515925E3-4359-4079-A24C-E7367560C95F}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{515925E3-4359-4079-A24C-E7367560C95F}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{515925E3-4359-4079-A24C-E7367560C95F}.Release|Any CPU.Build.0 = Release|Any CPU
2449
EndGlobalSection
2550
GlobalSection(SolutionProperties) = preSolution
2651
HideSolutionNode = FALSE
2752
EndGlobalSection
53+
GlobalSection(NestedProjects) = preSolution
54+
{369E8A80-AC62-4F8E-9CE3-AE5E6A35925E} = {432F4069-691C-498A-8017-81E41CBF0CCD}
55+
{45A8B12E-ED81-4D4B-A784-23DB221EBA6F} = {E0BAC0FB-2A34-4E10-A2D2-4E587E50A47A}
56+
{E72256FA-DFF3-4487-AA94-E6D5BD1BDD2D} = {432F4069-691C-498A-8017-81E41CBF0CCD}
57+
{515925E3-4359-4079-A24C-E7367560C95F} = {432F4069-691C-498A-8017-81E41CBF0CCD}
58+
EndGlobalSection
2859
EndGlobal

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
![](https://geeklearning.visualstudio.com/_apis/public/build/definitions/f841b266-7595-4d01-9ee1-4864cf65aa73/5/badge)
2-
# gl-dotnet-storage
1+
[![NuGet Pre Release](https://img.shields.io/nuget/vpre/GeekLearning.Templating.svg?maxAge=2592000)]()
2+
[![NuGet Pre Release](https://img.shields.io/nuget/vpre/GeekLearning.Templating.Handlebars.svg?maxAge=2592000)]()
3+
[![NuGet Pre Release](https://img.shields.io/nuget/vpre/GeekLearning.Templating.Mustache.svg?maxAge=2592000)]()
4+
[![Build Status](https://geeklearning.visualstudio.com/_apis/public/build/definitions/f841b266-7595-4d01-9ee1-4864cf65aa73/24/badge)](#)
5+
6+
# gl-dotnet-templating
37

48
Coming Soon!
59

6-
#Storage Abstraction
10+
#Templating Abstraction
711

8-
#FileSystem provider
12+
#Handlebars provider
913

10-
#Azure blob provider
14+
#Mustache.js provider

global.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"projects": [ "src", "samples" ]
2+
"projects": [ "src", "samples" ],
3+
"sdk": {
4+
"version": "1.0.0-preview1-002702"
5+
}
36
}

src/GeekLearning.Templating.BasicSample/Controllers/TestController.cs renamed to samples/GeekLearning.Templating.BasicSample/Controllers/TestController.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public TestController(EmailTemplates templates)
1717
}
1818

1919
// POST api/values
20-
[HttpPost]
21-
public async Task<string> Post([FromBody]InvitationContext value)
20+
[HttpGet]
21+
public async Task<string> Post([FromQuery]InvitationContext value)
2222
{
2323
try
2424
{
@@ -29,5 +29,19 @@ public async Task<string> Post([FromBody]InvitationContext value)
2929
return ice.InnerException.Message;
3030
}
3131
}
32+
33+
// POST api/values
34+
[HttpGet("2")]
35+
public async Task<string> Post2([FromQuery]InvitationContext value)
36+
{
37+
try
38+
{
39+
return await templates.ApplyInvitation2Template(value);
40+
}
41+
catch (InvalidContextException ice)
42+
{
43+
return ice.InnerException.Message;
44+
}
45+
}
3246
}
3347
}

src/GeekLearning.Templating.BasicSample/EmailTemplates.cs renamed to samples/GeekLearning.Templating.BasicSample/EmailTemplates.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ public EmailTemplates(IStorageFactory storageFactory, ITemplateLoaderFactory tem
1515

1616
public Task<string> ApplyInvitationTemplate(InvitationContext context)
1717
{
18-
return this.LoadAndApplyTemplate("invitation.hbs", context);
18+
return this.LoadAndApplyTemplate("invitation", context);
19+
}
20+
21+
public Task<string> ApplyInvitation2Template(InvitationContext context)
22+
{
23+
return this.LoadAndApplyTemplate("invitation2", context);
1924
}
2025
}
2126
}

src/GeekLearning.Templating.BasicSample/GeekLearning.Templating.BasicSample.xproj renamed to samples/GeekLearning.Templating.BasicSample/GeekLearning.Templating.BasicSample.xproj

File renamed without changes.

src/GeekLearning.Templating.BasicSample/InvitationContext.cs renamed to samples/GeekLearning.Templating.BasicSample/InvitationContext.cs

File renamed without changes.
File renamed without changes.

src/GeekLearning.Templating.BasicSample/Properties/launchSettings.json renamed to samples/GeekLearning.Templating.BasicSample/Properties/launchSettings.json

File renamed without changes.

src/GeekLearning.Templating.BasicSample/Startup.cs renamed to samples/GeekLearning.Templating.BasicSample/Startup.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
namespace GeekLearning.Templating.BasicSample
22
{
3-
using Microsoft.Extensions.Options;
43
using Microsoft.Extensions.Configuration;
54
using Microsoft.Extensions.DependencyInjection;
65
using Microsoft.Extensions.Logging;
7-
using GeekLearning.Storage;
6+
using Storage;
87
using Microsoft.AspNetCore.Hosting;
98
using Microsoft.AspNetCore.Builder;
9+
1010
public class Startup
1111
{
1212
public Startup(IHostingEnvironment env)
@@ -26,10 +26,10 @@ public void ConfigureServices(IServiceCollection services)
2626
{
2727
// Add framework services.
2828
services.AddMvc();
29-
30-
services.AddStorage().AddFileSystemStorage();
29+
services.AddMemoryCache();
30+
services.AddStorage().AddFileSystemStorage().AddAzureStorage();
3131
services.Configure<StorageOptions>(Configuration.GetSection("Storage"));
32-
services.AddTemplating().AddMustache();
32+
services.AddTemplating().AddMustache().AddHandlebars();
3333

3434
services.AddScoped<EmailTemplates>();
3535
}

0 commit comments

Comments
 (0)