Fujiy.Util
1.1.0
Install-Package Fujiy.Util -Version 1.1.0
dotnet add package Fujiy.Util --version 1.1.0
<PackageReference Include="Fujiy.Util" Version="1.1.0" />
paket add Fujiy.Util --version 1.1.0
#r "nuget: Fujiy.Util, 1.1.0"
// Install Fujiy.Util as a Cake Addin
#addin nuget:?package=Fujiy.Util&version=1.1.0
// Install Fujiy.Util as a Cake Tool
#tool nuget:?package=Fujiy.Util&version=1.1.0
With this package you get data from cache or calling your method writing just one line of code.
Usually you do this(for ValueTypes, but Ref Types are similar):
decimal price;
var returnFromCache = Cache["CarClassGetPrice" + carId];
if(returnFromCache is decimal)
{
price = (decimal)returnFromCache;
}
else
{
price = GetPrice(carId);
Cache["CarClassGetPrice" + carId] = price;
}
With Fujiy.Util you just write:
decimal price = CacheHelper.FromCacheOrExecute(() => myObj.GetPrice(carId));
Product | Versions |
---|---|
.NET Framework | net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version 1.1.0
* Support for Task results. Ignores cached Tasks if Status is Faulted or Canceled