Skip to content

Commit 873ffa8

Browse files
authored
Merge pull request #14 from f7q/delete
delete
2 parents 0d9250b + 7bdba62 commit 873ffa8

47 files changed

Lines changed: 977 additions & 279 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ bin/
44
obj/
55
src/WebApplication/node_modules/
66
*.xproj.user
7-
*.lock.json
7+
*.lock.json
8+
*.dll
9+
*.log

NuGet.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="local" value="package" />
5+
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
<disabledPackageSources>
8+
<add key="local" value="true" />
9+
</disabledPackageSources>
10+
</configuration>

WebApplication.sln

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExtensionA", "ExtensionA",
1818
EndProject
1919
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExtensionB", "ExtensionB", "{4EA56716-702B-485A-A23A-10E110A85D78}"
2020
EndProject
21-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.ExtensionB.Data.Models", "src\WebApplication.ExtensionB.Data.Models\WebApplication.ExtensionB.Data.Models.xproj", "{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}"
22-
EndProject
2321
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.ExtensionB", "src\WebApplication.ExtensionB\WebApplication.ExtensionB.xproj", "{396A8530-C500-469E-9F6F-A2D9C286C47D}"
2422
EndProject
25-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.ExtensionB.Data.Abstractions", "src\WebApplication.ExtensionB.Data.Abstractions\WebApplication.ExtensionB.Data.Abstractions.xproj", "{922E22BD-10F8-4261-9ACC-9CD10A4C8147}"
23+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NLog", "NLog", "{511BD310-4C03-407B-92EA-34110884C547}"
24+
EndProject
25+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.NLog", "src\WebApplication.NLog\WebApplication.NLog.xproj", "{9E4B65AB-3F34-4C81-B02D-8E5643D2B3B9}"
26+
EndProject
27+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Swagger", "Swagger", "{8327C820-20D1-4095-8771-E03613D1969F}"
28+
EndProject
29+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.Swagger", "src\WebApplication.Swagger\WebApplication.Swagger.xproj", "{95E5595E-410B-4A6D-8822-4C07FDC3CF21}"
30+
EndProject
31+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebAPI", "WebAPI", "{FDEA400A-7F71-4A17-8419-030D80F74A3F}"
32+
EndProject
33+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.WebAPI", "src\WebApplication.WebAPI\WebApplication.WebAPI.xproj", "{7DE66111-BBB6-4C93-B864-9E65CAFD505B}"
34+
EndProject
35+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elm", "Elm", "{C49636B1-231E-45A2-8901-10EC68C7CB55}"
2636
EndProject
27-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.ExtensionB.Data.EntityFramework.Sqlite", "src\WebApplication.ExtensionB.Data.EntityFramework.Sqlite\WebApplication.ExtensionB.Data.EntityFramework.Sqlite.xproj", "{AF7B3C14-BC6E-4964-BD0B-5233428349B6}"
37+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication.Elm", "src\WebApplication.Elm\WebApplication.Elm.xproj", "{A5C5400D-DD78-4192-B34B-06D81996F0DA}"
2838
EndProject
2939
Global
3040
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -40,22 +50,26 @@ Global
4050
{8D722841-4E2C-4673-A7CC-C2690EFE3915}.Debug|Any CPU.Build.0 = Debug|Any CPU
4151
{8D722841-4E2C-4673-A7CC-C2690EFE3915}.Release|Any CPU.ActiveCfg = Release|Any CPU
4252
{8D722841-4E2C-4673-A7CC-C2690EFE3915}.Release|Any CPU.Build.0 = Release|Any CPU
43-
{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44-
{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
45-
{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
46-
{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Release|Any CPU.Build.0 = Release|Any CPU
4753
{396A8530-C500-469E-9F6F-A2D9C286C47D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4854
{396A8530-C500-469E-9F6F-A2D9C286C47D}.Debug|Any CPU.Build.0 = Debug|Any CPU
4955
{396A8530-C500-469E-9F6F-A2D9C286C47D}.Release|Any CPU.ActiveCfg = Release|Any CPU
5056
{396A8530-C500-469E-9F6F-A2D9C286C47D}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52-
{922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Debug|Any CPU.Build.0 = Debug|Any CPU
53-
{922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Release|Any CPU.Build.0 = Release|Any CPU
55-
{AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56-
{AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
57-
{AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
58-
{AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Release|Any CPU.Build.0 = Release|Any CPU
57+
{9E4B65AB-3F34-4C81-B02D-8E5643D2B3B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58+
{9E4B65AB-3F34-4C81-B02D-8E5643D2B3B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
59+
{9E4B65AB-3F34-4C81-B02D-8E5643D2B3B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{9E4B65AB-3F34-4C81-B02D-8E5643D2B3B9}.Release|Any CPU.Build.0 = Release|Any CPU
61+
{95E5595E-410B-4A6D-8822-4C07FDC3CF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62+
{95E5595E-410B-4A6D-8822-4C07FDC3CF21}.Debug|Any CPU.Build.0 = Debug|Any CPU
63+
{95E5595E-410B-4A6D-8822-4C07FDC3CF21}.Release|Any CPU.ActiveCfg = Release|Any CPU
64+
{95E5595E-410B-4A6D-8822-4C07FDC3CF21}.Release|Any CPU.Build.0 = Release|Any CPU
65+
{7DE66111-BBB6-4C93-B864-9E65CAFD505B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66+
{7DE66111-BBB6-4C93-B864-9E65CAFD505B}.Debug|Any CPU.Build.0 = Debug|Any CPU
67+
{7DE66111-BBB6-4C93-B864-9E65CAFD505B}.Release|Any CPU.ActiveCfg = Release|Any CPU
68+
{7DE66111-BBB6-4C93-B864-9E65CAFD505B}.Release|Any CPU.Build.0 = Release|Any CPU
69+
{A5C5400D-DD78-4192-B34B-06D81996F0DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70+
{A5C5400D-DD78-4192-B34B-06D81996F0DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
71+
{A5C5400D-DD78-4192-B34B-06D81996F0DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
72+
{A5C5400D-DD78-4192-B34B-06D81996F0DA}.Release|Any CPU.Build.0 = Release|Any CPU
5973
EndGlobalSection
6074
GlobalSection(SolutionProperties) = preSolution
6175
HideSolutionNode = FALSE
@@ -65,9 +79,14 @@ Global
6579
{8D722841-4E2C-4673-A7CC-C2690EFE3915} = {F92B44CF-63EE-4781-8244-48ACC5386A8C}
6680
{F92B44CF-63EE-4781-8244-48ACC5386A8C} = {0D7AEFA3-ABB0-4AF1-A4C1-F8E05C241753}
6781
{4EA56716-702B-485A-A23A-10E110A85D78} = {0D7AEFA3-ABB0-4AF1-A4C1-F8E05C241753}
68-
{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF} = {4EA56716-702B-485A-A23A-10E110A85D78}
6982
{396A8530-C500-469E-9F6F-A2D9C286C47D} = {4EA56716-702B-485A-A23A-10E110A85D78}
70-
{922E22BD-10F8-4261-9ACC-9CD10A4C8147} = {4EA56716-702B-485A-A23A-10E110A85D78}
71-
{AF7B3C14-BC6E-4964-BD0B-5233428349B6} = {4EA56716-702B-485A-A23A-10E110A85D78}
83+
{511BD310-4C03-407B-92EA-34110884C547} = {0D7AEFA3-ABB0-4AF1-A4C1-F8E05C241753}
84+
{9E4B65AB-3F34-4C81-B02D-8E5643D2B3B9} = {511BD310-4C03-407B-92EA-34110884C547}
85+
{8327C820-20D1-4095-8771-E03613D1969F} = {0D7AEFA3-ABB0-4AF1-A4C1-F8E05C241753}
86+
{95E5595E-410B-4A6D-8822-4C07FDC3CF21} = {8327C820-20D1-4095-8771-E03613D1969F}
87+
{FDEA400A-7F71-4A17-8419-030D80F74A3F} = {0D7AEFA3-ABB0-4AF1-A4C1-F8E05C241753}
88+
{7DE66111-BBB6-4C93-B864-9E65CAFD505B} = {FDEA400A-7F71-4A17-8419-030D80F74A3F}
89+
{C49636B1-231E-45A2-8901-10EC68C7CB55} = {0D7AEFA3-ABB0-4AF1-A4C1-F8E05C241753}
90+
{A5C5400D-DD78-4192-B34B-06D81996F0DA} = {C49636B1-231E-45A2-8901-10EC68C7CB55}
7291
EndGlobalSection
7392
EndGlobal

src/WebApplication.Elm/Elm.cs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using ExtCore.Infrastructure;
6+
using Microsoft.AspNetCore.Builder;
7+
using Microsoft.AspNetCore.Routing;
8+
using Microsoft.Extensions.Configuration;
9+
using Microsoft.Extensions.DependencyInjection;
10+
using Microsoft.AspNetCore.Hosting;
11+
using Microsoft.AspNetCore.Http;
12+
using Microsoft.Extensions.Logging;
13+
14+
namespace WebApplication.Elm
15+
{
16+
public class Elm : IExtension
17+
{
18+
private IConfigurationRoot configurationRoot;
19+
20+
public string Name
21+
{
22+
get
23+
{
24+
return "Extension Elm";
25+
}
26+
}
27+
28+
public IDictionary<int, Action<IRouteBuilder>> RouteRegistrarsByPriorities
29+
{
30+
get
31+
{
32+
return null;
33+
}
34+
}
35+
36+
37+
public int ConfigureServicesPriorities
38+
{
39+
get
40+
{
41+
return 100;
42+
}
43+
}
44+
public int ConfigurePriorities
45+
{
46+
get
47+
{
48+
return 100;
49+
}
50+
}
51+
public void SetConfigurationRoot(IConfigurationRoot configurationRoot)
52+
{
53+
this.configurationRoot = configurationRoot;
54+
}
55+
56+
public void ConfigureServices(IServiceCollection services)
57+
{
58+
services.AddElm(options =>
59+
{
60+
options.Path = new PathString("/Elm"); // defaults to "/Elm"
61+
options.Filter = (name, level) => level >= LogLevel.Information;
62+
});
63+
}
64+
65+
public void Configure(IApplicationBuilder app)
66+
{
67+
app.UseElmPage(); // Shows the logs at the specified path
68+
app.UseElmCapture(); // Adds the ElmLoggerProvider
69+
var factory = app.ApplicationServices.GetService<ILoggerFactory>();
70+
var logger = factory.CreateLogger<Elm>();
71+
using (logger.BeginScope("startup"))
72+
{
73+
logger.LogWarning("Starting up");
74+
}
75+
76+
/*app.Run(async context =>
77+
{
78+
await context.Response.WriteAsync("Hello world");
79+
using (logger.BeginScope("world"))
80+
{
81+
logger.LogInformation("Hello world!");
82+
logger.LogError("Mort");
83+
}
84+
// This will not get logged because the filter has been set to LogLevel.Information and above
85+
using (logger.BeginScope("debug"))
86+
{
87+
logger.LogDebug("some debug stuff");
88+
}
89+
});*/
90+
logger.LogInformation("This message is not in a scope");
91+
}
92+
}
93+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyConfiguration("")]
9+
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyProduct("WebApplication.Elm")]
11+
[assembly: AssemblyTrademark("")]
12+
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
15+
// COM, set the ComVisible attribute to true on that type.
16+
[assembly: ComVisible(false)]
17+
18+
// The following GUID is for the ID of the typelib if this project is exposed to COM
19+
[assembly: Guid("a5c5400d-dd78-4192-b34b-06d81996f0da")]

src/WebApplication.ExtensionB.Data.Models/WebApplication.ExtensionB.Data.Models.xproj renamed to src/WebApplication.Elm/WebApplication.Elm.xproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
55
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
66
</PropertyGroup>
7+
78
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
89
<PropertyGroup Label="Globals">
9-
<ProjectGuid>6eb08c04-9ca2-48b7-9404-3188afa3e2df</ProjectGuid>
10-
<RootNamespace>WebApplication.ExtensionB.Data.Models</RootNamespace>
10+
<ProjectGuid>a5c5400d-dd78-4192-b34b-06d81996f0da</ProjectGuid>
11+
<RootNamespace>WebApplication.Elm</RootNamespace>
1112
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
1213
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
1415
</PropertyGroup>
16+
1517
<PropertyGroup>
1618
<SchemaVersion>2.0</SchemaVersion>
1719
</PropertyGroup>
1820
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
19-
</Project>
21+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "1.0.0-*",
3+
4+
"dependencies": {
5+
"NETStandard.Library": "1.6.0",
6+
"ExtCore.Infrastructure": "1.0.0-alpha901",
7+
"Microsoft.AspNetCore.Mvc": "1.0.0",
8+
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
9+
"Microsoft.AspNetCore.Diagnostics.Elm": "0.1.0"
10+
},
11+
12+
"frameworks": {
13+
"netstandard1.6": {
14+
"imports": "dnxcore50"
15+
}
16+
}
17+
}

src/WebApplication.ExtensionA/ExtensionA.cs

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,61 @@
1111

1212
namespace WebApplication.ExtensionA
1313
{
14-
public class ExtensionA : IExtension
15-
{
16-
private IConfigurationRoot configurationRoot;
17-
18-
public string Name
14+
public class ExtensionA : IExtension
1915
{
20-
get
21-
{
22-
return "Extension A";
23-
}
24-
}
16+
private IConfigurationRoot configurationRoot;
2517

26-
public IDictionary<int, Action<IRouteBuilder>> RouteRegistrarsByPriorities
27-
{
28-
get
29-
{
30-
Dictionary<int, Action<IRouteBuilder>> routeRegistrarsByPriorities = new Dictionary<int, Action<IRouteBuilder>>();
31-
32-
routeRegistrarsByPriorities.Add(
33-
1000,
34-
routeBuilder =>
35-
{
36-
routeBuilder.MapRoute(name: "Extension A", template: "", defaults: new { controller = "ExtensionA", action = "Index" });
37-
}
38-
);
39-
40-
return routeRegistrarsByPriorities;
41-
}
42-
}
18+
public string Name
19+
{
20+
get
21+
{
22+
return "Extension A";
23+
}
24+
}
4325

44-
public void SetConfigurationRoot(IConfigurationRoot configurationRoot)
45-
{
46-
this.configurationRoot = configurationRoot;
47-
}
26+
public IDictionary<int, Action<IRouteBuilder>> RouteRegistrarsByPriorities
27+
{
28+
get
29+
{
30+
Dictionary<int, Action<IRouteBuilder>> routeRegistrarsByPriorities = new Dictionary<int, Action<IRouteBuilder>>();
4831

49-
public void ConfigureServices(IServiceCollection services)
50-
{
51-
}
32+
routeRegistrarsByPriorities.Add(
33+
2500,
34+
routeBuilder =>
35+
{
36+
routeBuilder.MapRoute(name: "Extension A", template: "", defaults: new { controller = "ExtensionA", action = "Index" });
37+
}
38+
);
5239

53-
public void Configure(IApplicationBuilder applicationBuilder)
54-
{
40+
return routeRegistrarsByPriorities;
41+
}
42+
}
43+
44+
public int ConfigureServicesPriorities
45+
{
46+
get
47+
{
48+
return 1000;
49+
}
50+
}
51+
public int ConfigurePriorities
52+
{
53+
get
54+
{
55+
return 1000;
56+
}
57+
}
58+
public void SetConfigurationRoot(IConfigurationRoot configurationRoot)
59+
{
60+
this.configurationRoot = configurationRoot;
61+
}
62+
63+
public void ConfigureServices(IServiceCollection services)
64+
{
65+
}
66+
67+
public void Configure(IApplicationBuilder applicationBuilder)
68+
{
69+
}
5570
}
56-
}
5771
}

src/WebApplication.ExtensionA/Views/ExtensionA/Index.cshtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<li>@item</li>
1919
}
2020
</ul>
21+
<p><a href="/swagger/ui/index.html">Go to Swagger</a></p>
2122
<p><a href="/extension-b">Go to Extension B</a></p>
23+
<p><a href="/Elm">Go to Elm</a></p>
2224
</body>
2325
</html>

src/WebApplication.ExtensionA/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"authors": [ "Dmitry Sikorsky" ],
33
"buildOptions": { "embed": [ "Styles/**", "Views/**" ] },
44
"dependencies": {
5-
"ExtCore.Infrastructure": "1.0.0-alpha9",
5+
"ExtCore.Infrastructure": "1.0.0-alpha901",
66
"Microsoft.AspNetCore.Mvc": "1.0.0",
77
"NETStandard.Library": "1.6.0"
88
},

0 commit comments

Comments
 (0)