init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
50
KretaWeb/Configuration/MobileApiConfigurationSection.cs
Normal file
50
KretaWeb/Configuration/MobileApiConfigurationSection.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Web.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Authorization configuration section for mobile API
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Configuration.ConfigurationSection" />
|
||||
public class MobileApiConfigurationSection : ConfigurationSection
|
||||
{
|
||||
const string SectionName = "MobileApiAuthorization";
|
||||
|
||||
/// <summary>
|
||||
/// The instance
|
||||
/// </summary>
|
||||
static Lazy<MobileApiConfigurationSection> instance;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The instance.
|
||||
/// </value>
|
||||
public static MobileApiConfigurationSection Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return instance.Value;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty(nameof(ApiKey), IsRequired = true)]
|
||||
public string ApiKey
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this[nameof(ApiKey)];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="MobileApiConfigurationSection"/> class.
|
||||
/// </summary>
|
||||
static MobileApiConfigurationSection()
|
||||
{
|
||||
instance = new Lazy<MobileApiConfigurationSection>(() => (MobileApiConfigurationSection)ConfigurationManager.GetSection(SectionName));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue