Skip to content

Commit 1360052

Browse files
committed
Add .NET Core 2.1 versions
1 parent f1abc11 commit 1360052

File tree

86 files changed

+28610
-1
lines changed

Some content is hidden

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

86 files changed

+28610
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.pyc
22
project.lock.json
33
bin/
4-
obj/
4+
obj/
5+
.vs/

ExampleVotingApp.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28010.2036
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vote", "vote\dotnet\Vote\Vote.csproj", "{9687EAF5-BFF3-4F8D-9C78-1B8EE12CE091}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker", "worker\dotnet\Worker\Worker.csproj", "{083764E8-4C34-43FB-A468-F80CE0ADE10A}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Result", "result\dotnet\Result\Result.csproj", "{9AD16D72-E3F5-4A76-814C-40EBD1EE7892}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{9687EAF5-BFF3-4F8D-9C78-1B8EE12CE091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{9687EAF5-BFF3-4F8D-9C78-1B8EE12CE091}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{9687EAF5-BFF3-4F8D-9C78-1B8EE12CE091}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{9687EAF5-BFF3-4F8D-9C78-1B8EE12CE091}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{083764E8-4C34-43FB-A468-F80CE0ADE10A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{083764E8-4C34-43FB-A468-F80CE0ADE10A}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{083764E8-4C34-43FB-A468-F80CE0ADE10A}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{083764E8-4C34-43FB-A468-F80CE0ADE10A}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{9AD16D72-E3F5-4A76-814C-40EBD1EE7892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{9AD16D72-E3F5-4A76-814C-40EBD1EE7892}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{9AD16D72-E3F5-4A76-814C-40EBD1EE7892}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{9AD16D72-E3F5-4A76-814C-40EBD1EE7892}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {9DEFC158-1225-4393-8A38-22256211D43D}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Threading.Tasks;
2+
using Microsoft.AspNetCore.SignalR;
3+
using Result.Models;
4+
5+
namespace Result.Hubs
6+
{
7+
public class ResultsHub : Hub
8+
{
9+
public async Task UpdateResults(ResultsModel results)
10+
{
11+
await Clients.All.SendAsync("UpdateResults", results);
12+
}
13+
}
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Result.Models
2+
{
3+
public class ResultsModel
4+
{
5+
public int OptionA { get; set; }
6+
7+
public int OptionB { get; set; }
8+
9+
public int VoteCount { get; set; }
10+
11+
public double OptionAPercent { get; set; }
12+
13+
public double OptionBPercent { get; set; }
14+
}
15+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@page
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Cats vs Dogs -- Result</title>
7+
<base href="/index.html">
8+
<meta name="viewport" content="width=device-width, initial-scale = 1.0">
9+
<meta name="keywords" content="docker-compose, docker, stack">
10+
<meta name="author" content="Docker">
11+
<link rel='stylesheet' href='/stylesheets/style.css' />
12+
</head>
13+
<body>
14+
<div id="background-stats">
15+
<div id="background-stats-1">
16+
</div>
17+
<!--
18+
-->
19+
<div id="background-stats-2">
20+
</div>
21+
</div>
22+
<div id="content-container">
23+
<div id="content-container-center">
24+
<div id="choice">
25+
<div class="choice cats">
26+
<div class="label">Cats</div>
27+
<div class="stat" id="optionA"></div>
28+
</div>
29+
<div class="divider"></div>
30+
<div class="choice dogs">
31+
<div class="label">Dogs</div>
32+
<div class="stat" id="optionB"></div>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
<div id="result">
38+
<span ng-if="total == 0">No votes yet</span>
39+
<span ng-if="total == 1">{{total}} vote</span>
40+
<span ng-if="total >= 2">{{total}} votes</span>
41+
</div>
42+
<script src="~/lib/signalr/dist/browser/signalr.js"></script>
43+
<script src="~/js/results.js"></script>
44+
</body>
45+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.AspNetCore.Mvc.RazorPages;
7+
8+
namespace Result.Pages
9+
{
10+
public class IndexModel : PageModel
11+
{
12+
public void OnGet()
13+
{
14+
15+
}
16+
}
17+
}

result/dotnet/Result/Program.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.Extensions.Configuration;
9+
using Microsoft.Extensions.Logging;
10+
11+
namespace Result
12+
{
13+
public class Program
14+
{
15+
public static void Main(string[] args)
16+
{
17+
CreateWebHostBuilder(args).Build().Run();
18+
}
19+
20+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21+
WebHost.CreateDefaultBuilder(args)
22+
.UseStartup<Startup>();
23+
}
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:56785",
7+
"sslPort": 44369
8+
}
9+
},
10+
"profiles": {
11+
"IIS Express": {
12+
"commandName": "IISExpress",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"Result": {
19+
"commandName": "Project",
20+
"launchBrowser": true,
21+
"applicationUrl": "https://localhost:5001;http://localhost:5000",
22+
"environmentVariables": {
23+
"ASPNETCORE_ENVIRONMENT": "Development"
24+
}
25+
}
26+
}
27+
}

result/dotnet/Result/Result.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.AspNetCore.App" />
9+
</ItemGroup>
10+
11+
</Project>

result/dotnet/Result/Startup.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.AspNetCore.Http;
8+
using Microsoft.AspNetCore.HttpsPolicy;
9+
using Microsoft.AspNetCore.Mvc;
10+
using Microsoft.Extensions.Configuration;
11+
using Microsoft.Extensions.DependencyInjection;
12+
using Result.Hubs;
13+
14+
namespace Result
15+
{
16+
public class Startup
17+
{
18+
public Startup(IConfiguration configuration)
19+
{
20+
Configuration = configuration;
21+
}
22+
23+
public IConfiguration Configuration { get; }
24+
25+
public void ConfigureServices(IServiceCollection services)
26+
{
27+
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
28+
services.AddSignalR();
29+
}
30+
31+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
32+
{
33+
if (env.IsDevelopment())
34+
{
35+
app.UseDeveloperExceptionPage();
36+
}
37+
else
38+
{
39+
app.UseExceptionHandler("/Error");
40+
}
41+
42+
app.UseStaticFiles();
43+
app.UseSignalR(routes =>
44+
{
45+
routes.MapHub<ResultsHub>("/resultsHub");
46+
});
47+
app.UseMvc();
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)