v1.1.3.0
This commit is contained in:
+3
-3
@@ -9,7 +9,7 @@ using System.Text;
|
||||
namespace Saxonite.Net.Core.Web.Base.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class SaxSessionConfig
|
||||
public class SaxAppConfig
|
||||
{
|
||||
//---------------------------------------------------------------
|
||||
// Data members.
|
||||
@@ -17,7 +17,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Construction.
|
||||
public SaxSessionConfig (String context, ConfigurationSection configSection, SaxSessionConfig defaultConfig)
|
||||
public SaxAppConfig (String context, ConfigurationSection configSection, SaxAppConfig defaultConfig)
|
||||
{
|
||||
Context = context;
|
||||
populateDefaults(defaultConfig);
|
||||
@@ -25,7 +25,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
private void populateDefaults(SaxSessionConfig defaultConfig)
|
||||
private void populateDefaults(SaxAppConfig defaultConfig)
|
||||
{
|
||||
if (defaultConfig == null) return;
|
||||
Security.Password.MinLength = defaultConfig.Security.Password.MinLength;
|
||||
@@ -44,7 +44,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
// Application components.
|
||||
public abstract String SessionCookieName { get; }
|
||||
public virtual SaxSessionContext SessionContext { get; protected set; }
|
||||
public abstract SaxSessionConfig SessionConfig { get; }
|
||||
public abstract SaxAppConfig AppConfig { get; }
|
||||
public override SaxConsoleHelper ConsoleHelper { get { return ConsoleHelper_Web; } }
|
||||
public SaxConsoleHelper_Web ConsoleHelper_Web { get; protected set; }
|
||||
public override IDatabaseInfo CreateCoreDbInfo(SaxSessionContext sessionContext) { return new DbDataItem.DatabaseInfo(GetCoreDatabase(sessionContext)); }
|
||||
@@ -60,14 +60,14 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
List<StringPair> applicationParams = new List<StringPair>();
|
||||
applicationParams.Add("Host", SaxSystem.ComputerName);
|
||||
applicationParams.Add("Version", Sax.Version.GetFullVersion());
|
||||
applicationParams.Add("Instance", InstanceType.ToString() + (!StringUtil.IsEmpty(SessionConfig.Instance) ? " [" + SessionConfig.Instance + "]" : ""));
|
||||
applicationParams.Add("Instance", InstanceType.ToString() + (!StringUtil.IsEmpty(AppConfig.Instance) ? " [" + AppConfig.Instance + "]" : ""));
|
||||
applicationParams.Add("Configuration", SaxSystem.DebugMode ? "Debug" : "Release");
|
||||
applicationParams.Add("Environment", EnvironmentName);
|
||||
applicationParams.Add("Database", SessionConfig.CoreDatabase.Location);
|
||||
applicationParams.Add("Database", AppConfig.CoreDatabase.Location);
|
||||
applicationParams.Add("Application root", SaxSystem.ApplicationFolder);
|
||||
if (!StringUtil.IsEmpty(SessionConfig.Documents.RootFolder))
|
||||
applicationParams.Add("Documents root", SessionConfig.Documents.RootFolder);
|
||||
applicationParams.Add("Email context", SessionConfig.Email.Context + (!StringUtil.IsEmpty(EmailConfig.SMTP.Server) ? " [" + EmailConfig.SMTP.Server + "]" : ""));
|
||||
if (!StringUtil.IsEmpty(AppConfig.Documents.RootFolder))
|
||||
applicationParams.Add("Documents root", AppConfig.Documents.RootFolder);
|
||||
applicationParams.Add("Email context", AppConfig.Email.Context + (!StringUtil.IsEmpty(EmailConfig.SMTP.Server) ? " [" + EmailConfig.SMTP.Server + "]" : ""));
|
||||
SaLogger.Info(fn + " Application start." + applicationParams.Select(item => StringUtil.PadRight(item.Item1 + ":", 20, ' ') + item.Item2).Concat("", "\n\t"), true);
|
||||
if (StringUtil.IsEmpty(EmailConfig.SMTP.Server) || StringUtil.IsEmpty(EmailConfig.Message.AddressFrom))
|
||||
SaLogger.Warn(fn + " Incomplete email configuration.", true);
|
||||
|
||||
@@ -110,7 +110,9 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
.AddViewLocalization(
|
||||
LanguageViewLocationExpanderFormat.Suffix,
|
||||
opts => { opts.ResourcesPath = resourcesPath; })
|
||||
.AddDataAnnotationsLocalization();
|
||||
.AddDataAnnotationsLocalization()
|
||||
// Ignore null values during object serisliation.
|
||||
.AddJsonOptions(options => { options.JsonSerializerOptions.IgnoreNullValues = true; });
|
||||
|
||||
// Configure localisation middleware.
|
||||
config.services.Configure<RequestLocalizationOptions>
|
||||
|
||||
Reference in New Issue
Block a user