Class IntExtensions
Provides extension methods for working with integer values.
Inherited Members
Namespace: mk.helpers
Assembly: mk.helpers.dll
Syntax
public static class IntExtensions
Methods
ZeroToNull(int)
Converts zero to null for non-nullable integer values.
Declaration
public static int? ZeroToNull(this int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The integer value to convert. |
Returns
| Type | Description |
|---|---|
| int? | Null if the value is zero; otherwise, the original integer value. |
ZeroToNull(int?)
Converts zero to null for nullable integer values.
Declaration
public static int? ZeroToNull(this int? value)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | value | The nullable integer value to convert. |
Returns
| Type | Description |
|---|---|
| int? | Null if the value is null or zero; otherwise, the original nullable integer value. |