This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class NLogExtensions | |
| { | |
| public static void WarnIf(this NLog.ILogger @this, bool condition, string message) | |
| { | |
| if (condition && @this.IsWarnEnabled) | |
| { | |
| @this.Warn(message); | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Implements a cache helper. | |
| /// Taken from http://codereview.stackexchange.com/questions/25907/asp-net-caching-helper (comments added). | |
| /// </summary> | |
| public static class CacheHelper | |
| { | |
| /// <summary> | |
| /// Retrieve the specified item from the cache if it is cached. Otherwise, insert it to the cache. | |
| /// Note: of the cache is not available, the <paramref name="initializer"/> method may be called on every call. | |
| /// </summary> |
OlderNewer