last ...
This commit is contained in:
@@ -14,7 +14,6 @@ using System.Threading.Tasks;
|
|||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json.Serialization;
|
using Newtonsoft.Json.Serialization;
|
||||||
|
|||||||
@@ -3,30 +3,34 @@ using Microsoft.Extensions.Configuration;
|
|||||||
using xCommons.Configurations;
|
using xCommons.Configurations;
|
||||||
using xCommons.Constants;
|
using xCommons.Constants;
|
||||||
|
|
||||||
namespace xCommons.Extensions {
|
namespace xCommons.Extensions
|
||||||
public static partial class IConfigurationExtensions {
|
{
|
||||||
|
public static partial class IConfigurationExtensions
|
||||||
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve AppConfiguration from Configurations
|
/// Retrieve AppConfiguration from Configurations
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="source"></param>
|
/// <param name="source"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static XAppConfiguration GetXAppConfiguration (this IConfiguration source) {
|
public static XAppConfiguration GetXAppConfiguration(this IConfiguration source)
|
||||||
|
{
|
||||||
//
|
//
|
||||||
var xMessageResourceTitlesConfigSection = source
|
var xMessageResourceTitlesConfigSection = source
|
||||||
.GetSection (ConfigurationNodeNames.MESSAGE_RESOURCE_TITLES_NODE);
|
.GetSection(ConfigurationNodeNames.MESSAGE_RESOURCE_TITLES_NODE);
|
||||||
|
|
||||||
//
|
//
|
||||||
var result = new XAppConfiguration {
|
var result = new XAppConfiguration
|
||||||
Name = source[nameof (XAppConfiguration.Name)],
|
{
|
||||||
Version = source[nameof (XAppConfiguration.Version)],
|
Name = source[nameof(XAppConfiguration.Name)],
|
||||||
XPoweredValue = source[nameof (XAppConfiguration.XPoweredValue)],
|
Version = source[nameof(XAppConfiguration.Version)],
|
||||||
WelcomeMessage = source[nameof (XAppConfiguration.WelcomeMessage)],
|
XPoweredValue = source[nameof(XAppConfiguration.XPoweredValue)],
|
||||||
|
WelcomeMessage = source[nameof(XAppConfiguration.WelcomeMessage)],
|
||||||
AllowedOrigins = source
|
AllowedOrigins = source
|
||||||
.GetSection (nameof (XAppConfiguration.AllowedOrigins))
|
.GetSection(nameof(XAppConfiguration.AllowedOrigins))
|
||||||
.Get<IEnumerable<string>> (),
|
.Get<IEnumerable<string>>(),
|
||||||
DefaultLanguage = source[nameof (XAppConfiguration.DefaultLanguage)],
|
DefaultLanguage = source[nameof(XAppConfiguration.DefaultLanguage)],
|
||||||
MessageResourceTitles = xMessageResourceTitlesConfigSection
|
MessageResourceTitles = xMessageResourceTitlesConfigSection
|
||||||
.Get<XMessageResourceTitles> ()
|
.Get<XMessageResourceTitles>()
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -38,11 +42,12 @@ namespace xCommons.Extensions {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="source"></param>
|
/// <param name="source"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static XSwaggerConfiguration GetXSwaggerConfiguration (this IConfiguration source) {
|
public static XSwaggerConfiguration GetXSwaggerConfiguration(this IConfiguration source)
|
||||||
|
{
|
||||||
//
|
//
|
||||||
var xSwaggerConfigSection = source
|
var xSwaggerConfigSection = source
|
||||||
.GetSection (ConfigurationNodeNames.SWAGGER_NODE);
|
.GetSection(ConfigurationNodeNames.SWAGGER_NODE);
|
||||||
return xSwaggerConfigSection.Get<XSwaggerConfiguration> ();
|
return xSwaggerConfigSection.Get<XSwaggerConfiguration>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user