Fujiy.Util 1.1.0

.NET Framework 4.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" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fujiy.Util --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Fujiy.Util, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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 Downloads Last updated
1.1.0 1,118 8/7/2014
1.0.0 1,111 4/1/2014

Version 1.1.0
* Support for Task results. Ignores cached Tasks if Status is Faulted or Canceled