Skip to content

Commit 6daa8a9

Browse files
author
Dmitry Sikorsky
committed
Updated to use ExtCore 2.0.0-alpha1
1 parent d837a74 commit 6daa8a9

File tree

7 files changed

+51
-62
lines changed

7 files changed

+51
-62
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ExtCore Framework 1.2.0 Sample MVC Web Application
1+
# ExtCore Framework 2.0.0-alpha1 Sample MVC Web Application
22

33
[![Join the chat at https://gitter.im/ExtCore/ExtCore](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ExtCore/ExtCore?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44

@@ -14,25 +14,25 @@ This is the ExtCore framework sample MVC web application.
1414

1515
* rebuild the solution;
1616
* copy the extensions DLL files into the Extensions folder of the main web application (this folder doesn’t exist by default,
17-
so you need to create it in the web application root or specify another location in the config.json file; also you may just
17+
so you need to create it in the web application root or specify another location in the appsettings.json file; also you may just
1818
add direct dependencies to the main web application project instead, but it is not so interesting);
1919
* run the main web application.
2020

2121
## More Information
2222

2323
### Other Samples
2424

25-
* [Full-featured ExtCore 1.2.0 framework sample web application](https://github.com/ExtCore/ExtCore-Sample);
26-
* [ExtCore framework 1.2.0 sample simplest web application](https://github.com/ExtCore/ExtCore-Sample-Simplest);
27-
* [ExtCore framework 1.2.0 sample web application that uses a database](https://github.com/ExtCore/ExtCore-Sample-Data);
28-
* [ExtCore framework 1.2.0 sample web application with modular UI](https://github.com/ExtCore/ExtCore-Sample-Modular-Ui);
29-
* [ExtCore framework 1.2.0 advanced sample web application with modular UI](https://github.com/ExtCore/ExtCore-Sample-Modular-Ui-Adv);
30-
* [ExtCore framework 1.2.0 advanced sample accounting web application](https://github.com/ExtCore/ExtCore-Sample-Accounting);
31-
* [ExtCore framework 1.2.0 sample web application that registers a service inside the extension](https://github.com/ExtCore/ExtCore-Sample-Service);
32-
* [ExtCore framework 1.2.0 sample web application that uses the events](https://github.com/ExtCore/ExtCore-Sample-Events);
33-
* [ExtCore framework 1.2.0 sample API web application](https://github.com/ExtCore/ExtCore-Sample-Api).
34-
35-
You can also download our [ready to use full-featured sample](http://extcore.net/files/ExtCore-Sample-1.2.0.zip).
25+
* [Full-featured ExtCore 2.0.0-alpha1 framework sample web application](https://github.com/ExtCore/ExtCore-Sample);
26+
* [ExtCore framework 2.0.0-alpha1 sample simplest web application](https://github.com/ExtCore/ExtCore-Sample-Simplest);
27+
* [ExtCore framework 2.0.0-alpha1 sample web application that uses a database](https://github.com/ExtCore/ExtCore-Sample-Data);
28+
* [ExtCore framework 2.0.0-alpha1 sample web application with modular UI](https://github.com/ExtCore/ExtCore-Sample-Modular-Ui);
29+
* [ExtCore framework 2.0.0-alpha1 advanced sample web application with modular UI](https://github.com/ExtCore/ExtCore-Sample-Modular-Ui-Adv);
30+
* [ExtCore framework 2.0.0-alpha1 advanced sample accounting web application](https://github.com/ExtCore/ExtCore-Sample-Accounting);
31+
* [ExtCore framework 2.0.0-alpha1 sample web application that registers a service inside the extension](https://github.com/ExtCore/ExtCore-Sample-Service);
32+
* [ExtCore framework 2.0.0-alpha1 sample web application that uses the events](https://github.com/ExtCore/ExtCore-Sample-Events);
33+
* [ExtCore framework 2.0.0-alpha1 sample API web application](https://github.com/ExtCore/ExtCore-Sample-Api).
34+
35+
You can also download our [ready to use full-featured sample](http://extcore.net/files/ExtCore-Sample-2.0.0-alpha1.zip).
3636
It contains everything you need to run ExtCore-based web application from Visual Studio 2017, including SQLite
3737
database with the test data.
3838

@@ -44,7 +44,7 @@ to help you start developing your ExtCore-based web applications.
4444
### Real Projects
4545

4646
Please take a look at [Platformus](https://github.com/Platformus/Platformus) on GitHub. It is CMS
47-
built on ExtCore framework with 10 extensions and 70 projects.
47+
built on ExtCore framework with more than 10 extensions and 70 projects.
4848

4949
## Links
5050

src/Extension/Actions/UseMvcAction.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright © 2017 Dmitry Sikorsky. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using ExtCore.Mvc.Infrastructure.Actions;
6+
using Microsoft.AspNetCore.Builder;
7+
using Microsoft.AspNetCore.Routing;
8+
9+
namespace Extension.Actions
10+
{
11+
public class UseMvcAction : IUseMvcAction
12+
{
13+
public int Priority => 1000;
14+
15+
public void Execute(IRouteBuilder routeBuilder, IServiceProvider serviceProvider)
16+
{
17+
routeBuilder.MapRoute(name: "Default", template: "{controller}/{action}", defaults: new { controller = "Default", action = "Index" });
18+
}
19+
}
20+
}

src/Extension/Extension.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Extension/Extension.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="ExtCore.Mvc.Infrastructure" Version="1.2.0" />
13+
<PackageReference Include="ExtCore.Mvc.Infrastructure" Version="2.0.0-alpha1" />
1414
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
1515
</ItemGroup>
1616

17-
<ItemGroup>
18-
<Folder Include="Properties\" />
19-
</ItemGroup>
20-
2117
</Project>

src/WebApplication/Startup.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright © 2017 Dmitry Sikorsky. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
using System;
4+
using ExtCore.WebApplication.Extensions;
55
using Microsoft.AspNetCore.Builder;
66
using Microsoft.AspNetCore.Hosting;
77
using Microsoft.Extensions.Configuration;
@@ -10,28 +10,29 @@
1010

1111
namespace WebApplication
1212
{
13-
public class Startup : ExtCore.WebApplication.Startup
13+
public class Startup
1414
{
15-
public Startup(IServiceProvider serviceProvider)
16-
: base (serviceProvider)
17-
{
18-
this.serviceProvider.GetService<ILoggerFactory>().AddConsole();
15+
private string extensionsPath;
1916

17+
public Startup(IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory)
18+
{
2019
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
21-
.SetBasePath(this.serviceProvider.GetService<IHostingEnvironment>().ContentRootPath)
22-
.AddJsonFile("config.json", optional: true, reloadOnChange: true);
20+
.SetBasePath(hostingEnvironment.ContentRootPath)
21+
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
22+
23+
IConfigurationRoot configurationRoot = configurationBuilder.Build();
2324

24-
this.configurationRoot = configurationBuilder.Build();
25+
this.extensionsPath = hostingEnvironment.ContentRootPath + configurationRoot["Extensions:Path"];
2526
}
2627

27-
public override void ConfigureServices(IServiceCollection services)
28+
public void ConfigureServices(IServiceCollection services)
2829
{
29-
base.ConfigureServices(services);
30+
services.AddExtCore(this.extensionsPath);
3031
}
3132

32-
public override void Configure(IApplicationBuilder applicationBuilder)
33+
public void Configure(IApplicationBuilder applicationBuilder)
3334
{
34-
base.Configure(applicationBuilder);
35+
applicationBuilder.UseExtCore();
3536
}
3637
}
3738
}

src/WebApplication/WebApplication.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="ExtCore.Mvc" Version="1.2.0" />
10-
<PackageReference Include="ExtCore.WebApplication" Version="1.2.0" />
9+
<PackageReference Include="ExtCore.Mvc" Version="2.0.0-alpha1" />
10+
<PackageReference Include="ExtCore.WebApplication" Version="2.0.0-alpha1" />
1111
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" />
1212
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
1313
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
File renamed without changes.

0 commit comments

Comments
 (0)