Added JsonTester
Added LicenserTester Added SqliteCacheTester Updated EnvTester Updated LoggerTester
This commit is contained in:
25
SqliteCacheTester/SqliteCacheTester.sln
Normal file
25
SqliteCacheTester/SqliteCacheTester.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33110.190
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqliteCacheTester", "SqliteCacheTester\SqliteCacheTester.csproj", "{013B9DD8-707B-40CE-8143-7649C9557128}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{013B9DD8-707B-40CE-8143-7649C9557128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{013B9DD8-707B-40CE-8143-7649C9557128}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{013B9DD8-707B-40CE-8143-7649C9557128}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{013B9DD8-707B-40CE-8143-7649C9557128}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {FA1E89EA-0D00-4FBA-8AED-3F46FF0A692D}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
31
SqliteCacheTester/SqliteCacheTester/DnsCache.cs
Normal file
31
SqliteCacheTester/SqliteCacheTester/DnsCache.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using EonaCat.Cache.Sqlite;
|
||||
|
||||
namespace SqliteCacheTester
|
||||
{
|
||||
public static class DnsCache
|
||||
{
|
||||
private static SqliteCache _cache;
|
||||
|
||||
static DnsCache()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
_cache = new SqliteCache();
|
||||
}
|
||||
|
||||
public static T? GetCacheAsync<T>(string cacheKey)
|
||||
{
|
||||
var cached = _cache.HasKey(cacheKey) ? _cache.Get<T>($"{cacheKey}") : default;
|
||||
return cached;
|
||||
}
|
||||
|
||||
public static void SetCache<T>(string cacheKey,
|
||||
T cachedObject)
|
||||
{
|
||||
_cache.Set(cacheKey, cachedObject);
|
||||
}
|
||||
}
|
||||
}
|
15
SqliteCacheTester/SqliteCacheTester/Program.cs
Normal file
15
SqliteCacheTester/SqliteCacheTester/Program.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using SqliteCacheTester;
|
||||
|
||||
var hoi = new TEST();
|
||||
hoi.Bar = "LOL";
|
||||
DnsCache.SetCache("MY_KEY", hoi);
|
||||
|
||||
var test = DnsCache.GetCacheAsync<TEST>("MY_KEY");
|
||||
Console.WriteLine(test);
|
||||
public class TEST
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public string Test { get; set; }
|
||||
public string Hello { get; set; }
|
||||
public string Bar { get; set; }
|
||||
}
|
26
SqliteCacheTester/SqliteCacheTester/SqliteCacheTester.csproj
Normal file
26
SqliteCacheTester/SqliteCacheTester/SqliteCacheTester.csproj
Normal file
@@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EonaCat.Json" Version="1.0.3" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="EonaCat.Cache.Sqlite">
|
||||
<HintPath>..\..\..\EonaCat.Cache.Sqlite\EonaCat.Cache.Sqlite\bin\Debug\net7.0\EonaCat.Cache.Sqlite.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user