mk.helpers
Search Results for

    Show / Hide Table of Contents

    Class IntExtensions

    Provides extension methods for working with integer values.

    Inheritance
    object
    IntExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In this article
    Back to top mk.helpers - MIT License