Using as the NuGet Packages¶
Using Platformus CMS as the NuGet packages is the preferred way (unless you consider the source code only as a starting point for your own project and do not need any updates in the future). Your host web application can contain any application-specific code, and you can extend the built-in features and modify the default behaviors using the Platformus public API.
- Create an ASP.NET Core host web application (or use an existing one):
- Open NuGet Package Manager and add dependencies on the following Platformus packages:
- Platformus.Core.Data.EntityFramework.Sqlite
- Platformus.Images
- Platformus.Website.Backend
- Platformus.Website.Data.EntityFramework.Sqlite
- Platformus.Website.Frontend
- Platformus.WebApplication
Or you can add them manually by editing .csproj file of your web application project:
<ItemGroup>
<PackageReference Include="Platformus.Core.Data.EntityFramework.Sqlite" Version="4.0.0" />
<PackageReference Include="Platformus.Images" Version="4.0.0" />
<PackageReference Include="Platformus.Website.Backend" Version="4.0.0" />
<PackageReference Include="Platformus.Website.Data.EntityFramework.SqlServer" Version="4.0.0" />
<PackageReference Include="Platformus.Website.Frontend" Version="4.0.0" />
<PackageReference Include="Platformus.WebApplication" Version="4.0.0" />
</ItemGroup>
- Open your
Startup
class.
Add the services.AddPlatformus()
extension method call inside the ConfigureServices
method:
public void ConfigureServices(IServiceCollection services)
{
services.AddPlatformus();
}
Add the StorageContextOptions
options class configuration inside the ConfigureServices
method
in order to provide the connection string (of course, you should take it from the application settings):
public void ConfigureServices(IServiceCollection services)
{
services.Configure<StorageContextOptions>(options =>
{
options.ConnectionString = this.configuration.GetConnectionString("Default");
}
);
services.AddPlatformus(this.extensionsPath);
}
Add the applicationBuilder.UsePlatformus()
extension method call inside the Configure
method:
public void Configure(IApplicationBuilder applicationBuilder, IWebHostEnvironment webHostEnvironment)
{
if (webHostEnvironment.IsDevelopment())
applicationBuilder.UseDeveloperExceptionPage();
applicationBuilder.UsePlatformus();
}
Don’t forget to include the Platformus.WebApplication.Extensions
namespace in order these extension methods to be resolved.
- Execute the Platformus database scripts on your database.
5. Run your web application and navigate to /backend to configure Platformus. Use the default “admin@platformus.net” and “admin” credentials to sign in.