Skip to content

Commit 7215b77

Browse files
author
Dmitry Sikorsky
committed
Updated to use ExtCore 2.0.0-alpha1
1 parent 971c732 commit 7215b77

File tree

23 files changed

+109
-98
lines changed

23 files changed

+109
-98
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Full-Featured ExtCore Framework 1.2.0 Sample Web Application
1+
# Full-Featured ExtCore Framework 2.0.0-alpha1 Sample 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,7 +14,7 @@ This is the full-featured ExtCore framework sample 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

@@ -32,7 +32,7 @@ add direct dependencies to the main web application project instead, but it is n
3232
* [ExtCore framework 1.2.0 sample web application that uses the events](https://github.com/ExtCore/ExtCore-Sample-Events);
3333
* [ExtCore framework 1.2.0 sample API web application](https://github.com/ExtCore/ExtCore-Sample-Api).
3434

35-
You can also download our [ready to use full-featured sample](http://extcore.net/files/ExtCore-Sample-1.2.0.zip).
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

WebApplication.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication", "src\WebAp
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionA", "src\WebApplication.ExtensionA\WebApplication.ExtensionA.csproj", "{8D722841-4E2C-4673-A7CC-C2690EFE3915}"
1515
EndProject
16-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionB.Data.Models", "src\WebApplication.ExtensionB.Data.Models\WebApplication.ExtensionB.Data.Models.csproj", "{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionB.Data.Entities", "src\WebApplication.ExtensionB.Data.Entities\WebApplication.ExtensionB.Data.Entities.csproj", "{6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}"
1717
EndProject
1818
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionB", "src\WebApplication.ExtensionB\WebApplication.ExtensionB.csproj", "{396A8530-C500-469E-9F6F-A2D9C286C47D}"
1919
EndProject
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 ExtensionA.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: "Extension A", template: "", defaults: new { controller = "ExtensionA", action = "Index" });
18+
}
19+
}
20+
}

src/WebApplication.ExtensionA/Controllers/ExtensionAController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ExtensionAController : Controller
1111
{
1212
public ActionResult Index()
1313
{
14-
return this.View(ExtensionManager.Extensions.Select(e => e.Name));
14+
return this.View(ExtensionManager.GetInstances<IExtension>().Select(e => e.Name));
1515
}
1616
}
1717
}
Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
// Copyright © 2015 Dmitry Sikorsky. All rights reserved.
1+
// 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;
5-
using System.Collections.Generic;
6-
using ExtCore.Mvc.Infrastructure;
7-
using Microsoft.AspNetCore.Builder;
8-
using Microsoft.AspNetCore.Routing;
4+
using ExtCore.Infrastructure;
95

106
namespace WebApplication.ExtensionA
117
{
12-
public class ExtensionA : ExtensionBase
8+
public class Extension : ExtensionBase
139
{
14-
public override IEnumerable<KeyValuePair<int, Action<IRouteBuilder>>> UseMvcActionsByPriorities
15-
{
16-
get
17-
{
18-
return new Dictionary<int, Action<IRouteBuilder>>()
19-
{
20-
[1000] = routeBuilder =>
21-
{
22-
routeBuilder.MapRoute(name: "Extension A", template: "", defaults: new { controller = "ExtensionA", action = "Index" });
23-
}
24-
};
25-
}
26-
}
10+
public override string Name => "ExtensionA";
2711
}
2812
}

src/WebApplication.ExtensionA/WebApplication.ExtensionA.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
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

src/WebApplication.ExtensionB.Data.Abstractions/IItemRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System.Collections.Generic;
55
using ExtCore.Data.Abstractions;
6-
using WebApplication.ExtensionB.Data.Models;
6+
using WebApplication.ExtensionB.Data.Entities;
77

88
namespace WebApplication.ExtensionB.Data.Abstractions
99
{

src/WebApplication.ExtensionB.Data.Abstractions/WebApplication.ExtensionB.Data.Abstractions.csproj

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

88
<ItemGroup>
9-
<PackageReference Include="ExtCore.Data.Abstractions" Version="1.2.0" />
9+
<PackageReference Include="ExtCore.Data.Abstractions" Version="2.0.0-alpha1" />
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<ProjectReference Include="..\WebApplication.ExtensionB.Data.Models\WebApplication.ExtensionB.Data.Models.csproj" />
13+
<ProjectReference Include="..\WebApplication.ExtensionB.Data.Entities\WebApplication.ExtensionB.Data.Entities.csproj" />
1414
</ItemGroup>
1515

1616
</Project>

src/WebApplication.ExtensionB.Data.Models/Item.cs renamed to src/WebApplication.ExtensionB.Data.Entities/Item.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright © 2015 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 ExtCore.Data.Models.Abstractions;
4+
using ExtCore.Data.Entities.Abstractions;
55

6-
namespace WebApplication.ExtensionB.Data.Models
6+
namespace WebApplication.ExtensionB.Data.Entities
77
{
88
public class Item : IEntity
99
{

src/WebApplication.ExtensionB.Data.Models/WebApplication.ExtensionB.Data.Models.csproj renamed to src/WebApplication.ExtensionB.Data.Entities/WebApplication.ExtensionB.Data.Entities.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="ExtCore.Data.Models.Abstractions" Version="1.2.0" />
9+
<PackageReference Include="ExtCore.Data.Entities.Abstractions" Version="2.0.0-alpha1" />
1010
</ItemGroup>
1111

1212
</Project>

0 commit comments

Comments
 (0)