A set of utilities to simplify development that do not fit into a separate assembly and have the ability to general use.
For use you needed install packages:
Install-Package Skidbladnir.Utility.Common
- Retry - retry policy implementation
Sample:var result = Retry.Do( () => DoSomething(), retryCount: 3, delay: TimeSpan.FromSeconds(1));
Try
- The class contains methods that allow you to perform operations with the ability to handle errors
Sample:var result = await Try.DoAsync(() => DoSomething());
- Pluarization - Attempts to pluralize the specified text according to the rules of the English language.
Sample:var text = "Index"; Console.WriteLine(text.Plural()); //Writes: Indexes
StreamExtentions
- The class contains methods for reading streams to memory
Sample:var streamBytes = fileStream.ReadAllBytes();
ObjectExtensions
- The class contains common methods forobjects
. At now only implementDeepClone
method. Sample:var a = new MyObject(); var cloneA = a.DeepClone();
Requires
- A static helper class that includes various parameter checking routines. Sample:string test = "not empty string"; test.StringNotNullOrEmpty(); // pass without exception MyObject a = null; a.ObjectNotNull(); // Throw exception with text `Object can't be null`