/Doulex

Doulex is a toolkit for daily dev. It's containing various extensions

Primary LanguageC#MIT LicenseMIT

Doulex

Build status GitHub issues GitHub license

Doulex is a toolkits for daily devs.

Nuget packages

Name Version Downloads
Doulex nuget stats

Usage

Basic usage

ObjectExtensions.RemoveNullProperty

RemoveNullProperty can remove null property from object.

var origin = new
{
    Name    = "John",
    Age     = 30,
    Address = (string?) null,
    Married = (bool?) null,
};
var newDynamic = origin.RemoveNullProperty();

// we got a new dynamic object without null property
// {
//     Name = "John",
//     Age = 30,
// }

DisposeTracking

DisposeTracking can let you make call when object is out of scope.

var obj = 100; // your object
using (var tracker = new DisposeTracking(obj, () => Console.WriteLine("Object is disposed.")))
{
    Console.WriteLine(tracker);     // output is 100
    // do something else
}
// output is "Object is disposed."

DoubleExtensions.AlmostEquals

Compare double values with a tolerance

using Doulex;

double a = 10.5;
a.AlmostEquals(10.5); // true

Final

Leave a comment on GitHub if you have any questions or suggestions.

Turn on the star if you like this project.

License

This project is licensed under the MIT License