This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,98 @@
namespace Kreta.Naplo.Infrastructure
{
/// <summary>
/// Global constants
/// </summary>
public static class Constants
{
/// <summary>
/// The empty string
/// </summary>
public const string EmptyString = "";
/// <summary>
/// Unknown institute
/// </summary>
public const string UnknownInstitute = "unknown_institute";
/// <summary>
/// The secret log value
/// </summary>
public const string SecretLogValue = "***";
/// <summary>
/// Minimum primary key value
/// </summary>
public const int MinimumPrimaryKeyValue = 1;
/// <summary>
/// Http
/// </summary>
public static class Http
{
/// <summary>
/// Media type names
/// </summary>
public static class MediaTypeName
{
/// <summary>
/// Application json type
/// </summary>
public const string ApplicationJson = "application/json";
}
/// <summary>
/// Headers
/// </summary>
public static class Headers
{
/// <summary>
/// User agent
/// </summary>
public const string UserAgent = "User-Agent";
}
}
/// <summary>
/// Service context parameters
/// </summary>
public static class ServiceContextParameters
{
/// <value>
/// The institute code.
/// </value>
public const string InstituteCode = nameof(InstituteCode);
/// <value>
/// The user identifier.
/// </value>
public const string UserId = nameof(UserId);
/// <value>
/// The tutelary identifier.
/// </value>
public const string TutelaryId = nameof(TutelaryId);
/// <summary>
/// User roles
/// </summary>
public const string UserRoles = nameof(UserRoles);
/// <value>
/// The base URL.
/// </value>
public const string BaseUrl = nameof(BaseUrl);
/// <value>
/// The API key.
/// </value>
public const string ApiKey = nameof(ApiKey);
/// <value>
/// The user agent.
/// </value>
public const string UsertAgent = nameof(UsertAgent);
}
}
}

View file

@ -0,0 +1,28 @@
using System.Web;
namespace Kreta.Naplo.Infrastructure
{
/// <summary>
/// Static helper methods
/// </summary>
public static class Helpers
{
/// <summary>
/// Http helpers
/// </summary>
public static class Http
{
/// <summary>
/// Combines the URL.
/// </summary>
/// <param name="baseUrl">The base URL.</param>
/// <param name="relativeUrl">The relative URL.</param>
/// <returns></returns>
public static string CombineUrl(string baseUrl, string relativeUrl)
{
return $"{VirtualPathUtility.AppendTrailingSlash(baseUrl)}{relativeUrl}";
}
}
}
}

View file

@ -0,0 +1,19 @@
using System.Net.Http;
using System.Text;
namespace Kreta.Naplo.Infrastructure
{
/// <summary>
/// Json content
/// </summary>
/// <seealso cref="System.Net.Http.StringContent" />
public class JsonContent : StringContent
{
/// <summary>
/// Initializes a new instance of the <see cref="JsonContent"/> class.
/// </summary>
/// <param name="content">Content</param>
public JsonContent(string content) : base(content, Encoding.UTF8, Constants.Http.MediaTypeName.ApplicationJson)
{ }
}
}

View file

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{120E1B9D-DAF1-4E96-A04E-9AC1DC551E8B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Kreta.Naplo.Infrastrucure</RootNamespace>
<AssemblyName>Kreta.Naplo.Infrastrucure</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kreta.Core.Validation, Version=2.0.16.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Kreta.Core.Validation.2.0.16\lib\net452\Kreta.Core.Validation.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Tools\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Constants.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="JsonContent.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Kreta.Core.Validation" version="2.0.16" targetFramework="net48" />
<package id="Meziantou.Analyzer" version="1.0.688" targetFramework="net48" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
<package id="System.IO" version="4.3.0" targetFramework="net48" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net48" />
<package id="System.Runtime" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net48" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net48" />
</packages>