├── .gitignore ├── LICENSE.txt ├── README.md ├── WebApplication.sln └── src ├── WebApplication.ExtensionA ├── Actions │ └── UseEndpointsAction.cs ├── Controllers │ └── ExtensionAController.cs ├── ExtensionA.cs ├── Styles │ └── typography.css ├── Views │ └── ExtensionA │ │ └── Index.cshtml └── WebApplication.ExtensionA.csproj ├── WebApplication.ExtensionB.Data.Abstractions ├── IItemRepository.cs └── WebApplication.ExtensionB.Data.Abstractions.csproj ├── WebApplication.ExtensionB.Data.Entities ├── Item.cs └── WebApplication.ExtensionB.Data.Entities.csproj ├── WebApplication.ExtensionB.Data.EntityFramework.Sqlite ├── EntityRegistrar.cs ├── ItemRepository.cs └── WebApplication.ExtensionB.Data.EntityFramework.Sqlite.csproj ├── WebApplication.ExtensionB ├── Actions │ └── UseEndpointsAction.cs ├── Controllers │ └── ExtensionBController.cs ├── ExtensionB.cs ├── ViewModels │ ├── ExtensionB │ │ └── Index │ │ │ ├── IndexViewModel.cs │ │ │ └── IndexViewModelFactory.cs │ └── Shared │ │ ├── ItemViewModel.cs │ │ └── ItemViewModelFactory.cs ├── Views │ ├── ExtensionB │ │ └── Index.cshtml │ └── Shared │ │ └── _Item.cshtml └── WebApplication.ExtensionB.csproj └── WebApplication ├── Program.cs ├── Properties └── launchSettings.json ├── Startup.cs ├── Views ├── Shared │ └── _Layout.cshtml ├── _ViewImports.cshtml └── _ViewStart.cshtml ├── WebApplication.csproj ├── appsettings.json ├── db.sqlite ├── gulpfile.js ├── package.json └── web.config /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | bin/ 3 | obj/ 4 | Extensions/ 5 | src/WebApplication/node_modules/ 6 | *.user 7 | /src/WebApplication/package-lock.json 8 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2015 Dmitry Sikorsky. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Full-Featured ExtCore Framework 9.0.0 Sample Web Application 2 | 3 | [![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) 4 | 5 | ## Introduction 6 | 7 | [ExtCore](https://github.com/ExtCore/ExtCore) is free, open source and cross-platform framework for creating 8 | modular and extendable web applications based on ASP.NET Core. It is built using the best and the most modern 9 | tools and languages (Visual Studio 2022, C# etc). Join our team! 10 | 11 | This is the full-featured ExtCore framework sample web application. 12 | 13 | ## Getting Started 14 | 15 | * rebuild the solution; 16 | * 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 appsettings.json file; also you may just 18 | add direct dependencies to the main web application project instead, but it is not so interesting); 19 | * run the main web application. 20 | 21 | ## More Information 22 | 23 | ### Other Samples 24 | 25 | * [ExtCore framework 9.0.0 sample simplest web application](https://github.com/ExtCore/ExtCore-Sample-Simplest); 26 | * [ExtCore framework 9.0.0 sample MVC web application](https://github.com/ExtCore/ExtCore-Sample-Mvc); 27 | * [ExtCore framework 9.0.0 sample web application that uses file storage](https://github.com/ExtCore/ExtCore-Sample-FileStorage); 28 | * [ExtCore framework 9.0.0 sample web application that uses a database](https://github.com/ExtCore/ExtCore-Sample-Data); 29 | * [ExtCore framework 9.0.0 sample web application that uses Identity](https://github.com/ExtCore/ExtCore-Sample-Identity); 30 | * [ExtCore framework 9.0.0 sample web application with modular UI](https://github.com/ExtCore/ExtCore-Sample-Modular-Ui); 31 | * [ExtCore framework 9.0.0 advanced sample web application with modular UI](https://github.com/ExtCore/ExtCore-Sample-Modular-Ui-Adv); 32 | * [ExtCore framework 9.0.0 advanced sample accounting web application](https://github.com/ExtCore/ExtCore-Sample-Accounting); 33 | * [ExtCore framework 9.0.0 sample web application that registers a service inside the extension](https://github.com/ExtCore/ExtCore-Sample-Service); 34 | * [ExtCore framework 9.0.0 sample web application that uses the events](https://github.com/ExtCore/ExtCore-Sample-Events); 35 | * [ExtCore framework 9.0.0 sample API web application](https://github.com/ExtCore/ExtCore-Sample-Api). 36 | 37 | You can also download our [ready to use full-featured sample](http://extcore.net/files/ExtCore-Sample-9.0.0.zip). 38 | It contains everything you need to run ExtCore-based web application from Visual Studio 2022, including SQLite 39 | database with the test data. 40 | 41 | ### Tutorials 42 | 43 | We have written [several tutorials](http://docs.extcore.net/en/latest/getting_started/index.html) 44 | to help you start developing your ExtCore-based web applications. 45 | 46 | ### Real Projects 47 | 48 | Please take a look at [Platformus](https://github.com/Platformus/Platformus) on GitHub. It is CMS 49 | built on ExtCore framework with 3 extensions and 25 projects. 50 | 51 | ## Links 52 | 53 | Sources on GitHub: https://github.com/ExtCore/ExtCore 54 | 55 | Website: http://extcore.net/ 56 | 57 | Docs: http://docs.extcore.net/ 58 | 59 | Author: http://sikorsky.pro/ -------------------------------------------------------------------------------- /WebApplication.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30711.63 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExtensionA", "ExtensionA", "{F92B44CF-63EE-4781-8244-48ACC5386A8C}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ExtensionB", "ExtensionB", "{4EA56716-702B-485A-A23A-10E110A85D78}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication", "src\WebApplication\WebApplication.csproj", "{B511B595-A980-4D5C-BC2A-BCCB4065B433}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionA", "src\WebApplication.ExtensionA\WebApplication.ExtensionA.csproj", "{8D722841-4E2C-4673-A7CC-C2690EFE3915}" 13 | EndProject 14 | 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}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionB", "src\WebApplication.ExtensionB\WebApplication.ExtensionB.csproj", "{396A8530-C500-469E-9F6F-A2D9C286C47D}" 17 | EndProject 18 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionB.Data.Abstractions", "src\WebApplication.ExtensionB.Data.Abstractions\WebApplication.ExtensionB.Data.Abstractions.csproj", "{922E22BD-10F8-4261-9ACC-9CD10A4C8147}" 19 | EndProject 20 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication.ExtensionB.Data.EntityFramework.Sqlite", "src\WebApplication.ExtensionB.Data.EntityFramework.Sqlite\WebApplication.ExtensionB.Data.EntityFramework.Sqlite.csproj", "{AF7B3C14-BC6E-4964-BD0B-5233428349B6}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Any CPU = Debug|Any CPU 25 | Release|Any CPU = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 28 | {B511B595-A980-4D5C-BC2A-BCCB4065B433}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {B511B595-A980-4D5C-BC2A-BCCB4065B433}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {B511B595-A980-4D5C-BC2A-BCCB4065B433}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {B511B595-A980-4D5C-BC2A-BCCB4065B433}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {8D722841-4E2C-4673-A7CC-C2690EFE3915}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {8D722841-4E2C-4673-A7CC-C2690EFE3915}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {8D722841-4E2C-4673-A7CC-C2690EFE3915}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {8D722841-4E2C-4673-A7CC-C2690EFE3915}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {6EB08C04-9CA2-48B7-9404-3188AFA3E2DF}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {396A8530-C500-469E-9F6F-A2D9C286C47D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {396A8530-C500-469E-9F6F-A2D9C286C47D}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {396A8530-C500-469E-9F6F-A2D9C286C47D}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {396A8530-C500-469E-9F6F-A2D9C286C47D}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {922E22BD-10F8-4261-9ACC-9CD10A4C8147}.Release|Any CPU.Build.0 = Release|Any CPU 48 | {AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Debug|Any CPU.Build.0 = Debug|Any CPU 50 | {AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {AF7B3C14-BC6E-4964-BD0B-5233428349B6}.Release|Any CPU.Build.0 = Release|Any CPU 52 | EndGlobalSection 53 | GlobalSection(SolutionProperties) = preSolution 54 | HideSolutionNode = FALSE 55 | EndGlobalSection 56 | GlobalSection(NestedProjects) = preSolution 57 | {8D722841-4E2C-4673-A7CC-C2690EFE3915} = {F92B44CF-63EE-4781-8244-48ACC5386A8C} 58 | {6EB08C04-9CA2-48B7-9404-3188AFA3E2DF} = {4EA56716-702B-485A-A23A-10E110A85D78} 59 | {396A8530-C500-469E-9F6F-A2D9C286C47D} = {4EA56716-702B-485A-A23A-10E110A85D78} 60 | {922E22BD-10F8-4261-9ACC-9CD10A4C8147} = {4EA56716-702B-485A-A23A-10E110A85D78} 61 | {AF7B3C14-BC6E-4964-BD0B-5233428349B6} = {4EA56716-702B-485A-A23A-10E110A85D78} 62 | EndGlobalSection 63 | GlobalSection(ExtensibilityGlobals) = postSolution 64 | SolutionGuid = {15D2F4E2-483E-4413-A40B-C19652CBD237} 65 | EndGlobalSection 66 | EndGlobal 67 | -------------------------------------------------------------------------------- /src/WebApplication.ExtensionA/Actions/UseEndpointsAction.cs: -------------------------------------------------------------------------------- 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 UseEndpointsAction : IUseEndpointsAction 12 | { 13 | public int Priority => 1000; 14 | 15 | public void Execute(IEndpointRouteBuilder endpointRouteBuilder, IServiceProvider serviceProvider) 16 | { 17 | endpointRouteBuilder.MapControllerRoute(name: "Extension A", pattern: "", defaults: new { controller = "ExtensionA", action = "Index" }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionA/Controllers/ExtensionAController.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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.Linq; 5 | using ExtCore.Infrastructure; 6 | using Microsoft.AspNetCore.Mvc; 7 | 8 | namespace WebApplication.ExtensionA.Controllers 9 | { 10 | public class ExtensionAController : Controller 11 | { 12 | public ActionResult Index() 13 | { 14 | return this.View(ExtensionManager.GetInstances().Select(e => e.Name)); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionA/ExtensionA.cs: -------------------------------------------------------------------------------- 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 ExtCore.Infrastructure; 5 | 6 | namespace WebApplication.ExtensionA 7 | { 8 | public class Extension : ExtensionBase 9 | { 10 | public override string Name => "ExtensionA"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionA/Styles/typography.css: -------------------------------------------------------------------------------- 1 | .from-resources { 2 | color: red; 3 | } 4 | 5 | .suspended { 6 | text-decoration: line-through; 7 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionA/Views/ExtensionA/Index.cshtml: -------------------------------------------------------------------------------- 1 | @* Copyright © 2015 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 | @model IEnumerable 4 | @{ 5 | this.ViewBag.Title = "View from Extension A"; 6 | } 7 |

View from Extension A (Added as Resource* Precompiled)

8 |

This line is red because of the rule in CSS-file added as resource (from Extension A).

9 |

Installed extensions:

10 | 16 |

Go to Extension B

17 |

* Razor runtime compilation is turned off by default starting from ASP.NET Core 3.0 and not supported by the ExtCore framework so far (9.0.0).

-------------------------------------------------------------------------------- /src/WebApplication.ExtensionA/WebApplication.ExtensionA.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dmitry Sikorsky 5 | net8.0 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(DefaultItemExcludes);Styles\** 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.Abstractions/IItemRepository.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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.Collections.Generic; 5 | using ExtCore.Data.Abstractions; 6 | using WebApplication.ExtensionB.Data.Entities; 7 | 8 | namespace WebApplication.ExtensionB.Data.Abstractions 9 | { 10 | public interface IItemRepository : IRepository 11 | { 12 | IEnumerable All(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.Abstractions/WebApplication.ExtensionB.Data.Abstractions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dmitry Sikorsky 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.Entities/Item.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 ExtCore.Data.Entities.Abstractions; 5 | 6 | namespace WebApplication.ExtensionB.Data.Entities 7 | { 8 | public class Item : IEntity 9 | { 10 | public int Id { get; set; } 11 | public string Name { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.Entities/WebApplication.ExtensionB.Data.Entities.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dmitry Sikorsky 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.EntityFramework.Sqlite/EntityRegistrar.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 ExtCore.Data.EntityFramework; 5 | using Microsoft.EntityFrameworkCore; 6 | using WebApplication.ExtensionB.Data.Entities; 7 | 8 | namespace WebApplication.ExtensionB.Data.EntityFramework.Sqlite 9 | { 10 | public class EntityRegistrar : IEntityRegistrar 11 | { 12 | public void RegisterEntities(ModelBuilder modelBuilder) 13 | { 14 | modelBuilder.Entity(etb => 15 | { 16 | etb.HasKey(e => e.Id); 17 | etb.Property(e => e.Id); 18 | etb.ToTable("Items"); 19 | } 20 | ); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.EntityFramework.Sqlite/ItemRepository.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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.Collections.Generic; 5 | using System.Linq; 6 | using ExtCore.Data.EntityFramework; 7 | using WebApplication.ExtensionB.Data.Abstractions; 8 | using WebApplication.ExtensionB.Data.Entities; 9 | 10 | namespace WebApplication.ExtensionB.Data.EntityFramework.Sqlite 11 | { 12 | public class ItemRepository : RepositoryBase, IItemRepository 13 | { 14 | public IEnumerable All() 15 | { 16 | return this.dbSet.OrderBy(i => i.Name); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB.Data.EntityFramework.Sqlite/WebApplication.ExtensionB.Data.EntityFramework.Sqlite.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dmitry Sikorsky 5 | net8.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/Actions/UseEndpointsAction.cs: -------------------------------------------------------------------------------- 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 ExtensionB.Actions 10 | { 11 | public class UseEndpointsAction : IUseEndpointsAction 12 | { 13 | public int Priority => 2000; 14 | 15 | public void Execute(IEndpointRouteBuilder endpointRouteBuilder, IServiceProvider serviceProvider) 16 | { 17 | endpointRouteBuilder.MapControllerRoute(name: "Extension B", pattern: "extension-b", defaults: new { controller = "ExtensionB", action = "Index" }); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/Controllers/ExtensionBController.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 ExtCore.Data.Abstractions; 5 | using Microsoft.AspNetCore.Mvc; 6 | using WebApplication.ExtensionB.Data.Abstractions; 7 | using WebApplication.ExtensionB.ViewModels.ExtenstionB; 8 | 9 | namespace WebApplication.ExtensionB.Controllers 10 | { 11 | public class ExtensionBController : Controller 12 | { 13 | private IStorage storage; 14 | 15 | public ExtensionBController(IStorage storage) 16 | { 17 | this.storage = storage; 18 | } 19 | 20 | public ActionResult Index() 21 | { 22 | return this.View(new IndexViewModelFactory().Create(this.storage.GetRepository().All())); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/ExtensionB.cs: -------------------------------------------------------------------------------- 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 ExtCore.Infrastructure; 5 | 6 | namespace WebApplication.ExtensionB 7 | { 8 | public class Extension : ExtensionBase 9 | { 10 | public override string Name => "ExtensionB"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/ViewModels/ExtensionB/Index/IndexViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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.Collections.Generic; 5 | using WebApplication.ExtensionB.ViewModels.Shared; 6 | 7 | namespace WebApplication.ExtensionB.ViewModels.ExtenstionB 8 | { 9 | public class IndexViewModel 10 | { 11 | public IEnumerable Items { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/ViewModels/ExtensionB/Index/IndexViewModelFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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.Collections.Generic; 5 | using System.Linq; 6 | using WebApplication.ExtensionB.Data.Entities; 7 | using WebApplication.ExtensionB.ViewModels.Shared; 8 | 9 | namespace WebApplication.ExtensionB.ViewModels.ExtenstionB 10 | { 11 | public class IndexViewModelFactory 12 | { 13 | public IndexViewModel Create(IEnumerable items) 14 | { 15 | return new IndexViewModel() 16 | { 17 | Items = items.Select(i => new ItemViewModelFactory().Create(i)) 18 | }; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/ViewModels/Shared/ItemViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 | namespace WebApplication.ExtensionB.ViewModels.Shared 5 | { 6 | public class ItemViewModel 7 | { 8 | public string Name { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/ViewModels/Shared/ItemViewModelFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 WebApplication.ExtensionB.Data.Entities; 5 | 6 | namespace WebApplication.ExtensionB.ViewModels.Shared 7 | { 8 | public class ItemViewModelFactory 9 | { 10 | public ItemViewModel Create(Item item) 11 | { 12 | return new ItemViewModel() 13 | { 14 | Name = item.Name 15 | }; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/Views/ExtensionB/Index.cshtml: -------------------------------------------------------------------------------- 1 | @* Copyright © 2015 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 | @model WebApplication.ExtensionB.ViewModels.ExtenstionB.IndexViewModel 4 | @{ 5 | this.ViewBag.Title = "View from Extension B"; 6 | } 7 |

View from Extension B (Added as Resource* Precompiled)

8 |

Items from SQLite database:

9 |
10 | @foreach (var item in this.Model.Items) 11 | { 12 | @Html.Partial("_Item", item) 13 | } 14 |
15 |

This line is red because of the rule in CSS-file added as resource (from Extension A).

16 |

So any extension can use resources from any other extension.

17 |

* Razor runtime compilation is turned off by default starting from ASP.NET Core 3.0 and not supported by the ExtCore framework so far (9.0.0).

-------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/Views/Shared/_Item.cshtml: -------------------------------------------------------------------------------- 1 | @* Copyright © 2015 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 | @model WebApplication.ExtensionB.ViewModels.Shared.ItemViewModel 4 |
5 | @Model.Name 6 |
-------------------------------------------------------------------------------- /src/WebApplication.ExtensionB/WebApplication.ExtensionB.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dmitry Sikorsky 5 | net8.0 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/WebApplication/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 Microsoft.AspNetCore; 5 | using Microsoft.AspNetCore.Hosting; 6 | 7 | namespace WebApplication 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | CreateWebHostBuilder(args).Build().Run(); 14 | } 15 | 16 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 17 | WebHost.CreateDefaultBuilder(args) 18 | .UseStartup(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/WebApplication/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:1234/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApplication": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000/", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/WebApplication/Startup.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2015 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 ExtCore.Data.EntityFramework; 5 | using ExtCore.WebApplication.Extensions; 6 | using Microsoft.AspNetCore.Builder; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Hosting; 11 | 12 | namespace WebApplication 13 | { 14 | public class Startup 15 | { 16 | private string extensionsPath; 17 | 18 | public IConfiguration Configuration { get; } 19 | 20 | public Startup(IConfiguration configuration, IWebHostEnvironment webHostEnvironment) 21 | { 22 | this.Configuration = configuration; 23 | this.extensionsPath = webHostEnvironment.ContentRootPath + this.Configuration["Extensions:Path"]; 24 | } 25 | 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddExtCore(this.extensionsPath, this.Configuration["Extensions:IncludingSubpaths"] == true.ToString()); 29 | services.Configure(options => 30 | { 31 | options.ConnectionString = this.Configuration.GetConnectionString("Default"); 32 | } 33 | ); 34 | } 35 | 36 | public void Configure(IApplicationBuilder applicationBuilder, IWebHostEnvironment webHostEnvironment) 37 | { 38 | if (webHostEnvironment.IsDevelopment()) 39 | applicationBuilder.UseDeveloperExceptionPage(); 40 | 41 | applicationBuilder.UseExtCore(); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /src/WebApplication/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @* Copyright © 2015 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 | 5 | 6 | 7 | @Html.Raw(this.ViewBag.Title as string) 8 | 9 | 10 | 11 |
12 | @RenderBody() 13 |
14 | 15 | -------------------------------------------------------------------------------- /src/WebApplication/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @* Copyright © 2015 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 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /src/WebApplication/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @* Copyright © 2015 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 | this.Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } -------------------------------------------------------------------------------- /src/WebApplication/WebApplication.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Dmitry Sikorsky 5 | net8.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/WebApplication/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Data Source=db.sqlite" 4 | }, 5 | "Extensions": { 6 | "Path": "/Extensions", 7 | "IncludingSubpaths": true 8 | } 9 | } -------------------------------------------------------------------------------- /src/WebApplication/db.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ExtCore/ExtCore-Sample/e53c6e09b8963017b4cc2994e34f87ad8c55f529/src/WebApplication/db.sqlite -------------------------------------------------------------------------------- /src/WebApplication/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require("gulp"); 2 | 3 | gulp.task( 4 | "copy-extensions", function (cb) { 5 | gulp.src(["../WebApplication.ExtensionA/bin/Debug/net8.0/WebApplication.ExtensionA.dll"]).pipe(gulp.dest("Extensions")); 6 | gulp.src(["../WebApplication.ExtensionB/bin/Debug/net8.0/WebApplication.ExtensionB.dll"]).pipe(gulp.dest("Extensions")); 7 | gulp.src(["../WebApplication.ExtensionB.Data.Abstractions/bin/Debug/netstandard2.0/WebApplication.ExtensionB.Data.Abstractions.dll"]).pipe(gulp.dest("Extensions")); 8 | gulp.src(["../WebApplication.ExtensionB.Data.EntityFramework.Sqlite/bin/Debug/net8.0/WebApplication.ExtensionB.Data.EntityFramework.Sqlite.dll"]).pipe(gulp.dest("Extensions")); 9 | gulp.src(["../WebApplication.ExtensionB.Data.Entities/bin/Debug/netstandard2.0/WebApplication.ExtensionB.Data.Entities.dll"]).pipe(gulp.dest("Extensions")); 10 | cb(); 11 | } 12 | ); -------------------------------------------------------------------------------- /src/WebApplication/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "gulp": "^4.0.0" 4 | }, 5 | "name": "WebApplication", 6 | "private": true, 7 | "version": "1.0.0" 8 | } 9 | -------------------------------------------------------------------------------- /src/WebApplication/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | --------------------------------------------------------------------------------