Localization fixes - table definition, SQL script naming, SQL script not marked as Embedded Resource, changed column name from IsCurrrent to IsDefault to reflect intent, set default language for site in _Host
This commit is contained in:
		| @ -1,4 +1,4 @@ | ||||
| using System; | ||||
| using System; | ||||
| using System.Linq; | ||||
| using Microsoft.AspNetCore.Http; | ||||
| using Microsoft.AspNetCore.Identity; | ||||
| @ -10,20 +10,24 @@ namespace Oqtane.Repository | ||||
| { | ||||
|     public class DBContextBase :  IdentityUserContext<IdentityUser>  | ||||
|     { | ||||
|         private Tenant _tenant; | ||||
|         private ITenantResolver _tenantResolver; | ||||
|         private IHttpContextAccessor _accessor; | ||||
|  | ||||
|         public DBContextBase(ITenantResolver tenantResolver, IHttpContextAccessor accessor) | ||||
|         { | ||||
|             _tenant = tenantResolver.GetTenant(); | ||||
|             _tenantResolver = tenantResolver; | ||||
|             _accessor = accessor; | ||||
|         } | ||||
|  | ||||
|         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||||
|         { | ||||
|             optionsBuilder.UseSqlServer(_tenant.DBConnectionString | ||||
|                     .Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory")?.ToString()) | ||||
|             ); | ||||
|             var tenant = _tenantResolver.GetTenant(); | ||||
|             if (tenant != null) | ||||
|             { | ||||
|                 optionsBuilder.UseSqlServer(tenant.DBConnectionString | ||||
|                         .Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory")?.ToString()) | ||||
|                 ); | ||||
|             } | ||||
|             base.OnConfiguring(optionsBuilder); | ||||
|         } | ||||
|  | ||||
|  | ||||
| @ -1,18 +1,32 @@ | ||||
| using System; | ||||
| using System; | ||||
| using System.Linq; | ||||
| using Microsoft.AspNetCore.Http; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Oqtane.Models; | ||||
| using Microsoft.Extensions.Configuration; | ||||
|  | ||||
| namespace Oqtane.Repository | ||||
| { | ||||
|     public class MasterDBContext : DbContext | ||||
|     { | ||||
|         private IHttpContextAccessor _accessor; | ||||
|         private IConfiguration _configuration; | ||||
|  | ||||
|         public MasterDBContext(DbContextOptions<MasterDBContext> options, IHttpContextAccessor accessor) : base(options) | ||||
|         public MasterDBContext(DbContextOptions<MasterDBContext> options, IHttpContextAccessor accessor, IConfiguration configuration) : base(options) | ||||
|         { | ||||
|             _accessor = accessor; | ||||
|             _configuration = configuration; | ||||
|         } | ||||
|  | ||||
|         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||||
|         { | ||||
|             if (!string.IsNullOrEmpty(_configuration.GetConnectionString("DefaultConnection"))) | ||||
|             { | ||||
|                 optionsBuilder.UseSqlServer(_configuration.GetConnectionString("DefaultConnection") | ||||
|                     .Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory")?.ToString()) | ||||
|                 ); | ||||
|             } | ||||
|             base.OnConfiguring(optionsBuilder); | ||||
|         } | ||||
|  | ||||
|         public virtual DbSet<Alias> Alias { get; set; } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker