An open API service indexing awesome lists of open source software.

https://github.com/rcarubbi/carubbi.extensions

A simple library extension-method based to common tasks
https://github.com/rcarubbi/carubbi.extensions

extension-methods

Last synced: 8 months ago
JSON representation

A simple library extension-method based to common tasks

Awesome Lists containing this project

README

          

# Carubbi.Extensions
A simple library extension-method based to common tasks

* Datatype conversions:

Rather than
```csharp
int? intVariable;
try
{
intVariable = Convert.ToInt32(str);
}
catch(Exception ex)
{
intVariable = defaultValue;
}
```

or

```csharp
if (!int.TryParse(str, out int intValue))
{
intValue = defaultValue;
}
```

You just use

```csharp
int? intVariable = str.To(defaultValue);
```