added HybridEnabled field to Site table to indicate if .NET MAUI hybrid applications can be integrated
This commit is contained in:
@ -119,7 +119,7 @@ namespace Oqtane.Controllers
|
||||
var assemblyList = new List<ClientAssembly>();
|
||||
|
||||
var site = _sites.GetSite(alias.SiteId);
|
||||
if (site != null && site.Runtime == "WebAssembly")
|
||||
if (site != null && (site.Runtime == "WebAssembly" || site.HybridEnabled))
|
||||
{
|
||||
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
|
||||
@ -201,7 +201,7 @@ namespace Oqtane.Controllers
|
||||
private byte[] GetZIP(string list, Alias alias)
|
||||
{
|
||||
var site = _sites.GetSite(alias.SiteId);
|
||||
if (site != null && site.Runtime == "WebAssembly")
|
||||
if (site != null && (site.Runtime == "WebAssembly" || site.HybridEnabled))
|
||||
{
|
||||
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
|
||||
|
@ -555,6 +555,7 @@ namespace Oqtane.Infrastructure
|
||||
SiteTemplateType = install.SiteTemplate,
|
||||
Runtime = (!string.IsNullOrEmpty(install.Runtime)) ? install.Runtime : _configManager.GetSection("Runtime").Value,
|
||||
RenderMode = (!string.IsNullOrEmpty(install.RenderMode)) ? install.RenderMode : _configManager.GetSection("RenderMode").Value,
|
||||
HybridEnabled = false
|
||||
};
|
||||
site = sites.AddSite(site);
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Oqtane.Databases.Interfaces;
|
||||
using Oqtane.Migrations.EntityBuilders;
|
||||
using Oqtane.Repository;
|
||||
|
||||
namespace Oqtane.Migrations.Tenant
|
||||
{
|
||||
[DbContext(typeof(TenantDBContext))]
|
||||
[Migration("Tenant.05.00.01.00")]
|
||||
public class AddSiteHybridEnabled : MultiDatabaseMigration
|
||||
{
|
||||
public AddSiteHybridEnabled(IDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||
siteEntityBuilder.AddBooleanColumn("HybridEnabled", true);
|
||||
siteEntityBuilder.UpdateColumn("HybridEnabled", "0", "bool", ""); // default to false
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||
siteEntityBuilder.DropColumn("HybridEnabled");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user