MethodResultWrapper 1.1.2

Suggested Alternatives

MethodResultWrapper 1.1.3

Additional Details

please upgrade to 1.1.3 that fixes a problem in the GetDeepMessage extension method

There is a newer version of this package available.
See the version list below for details.
Install-Package MethodResultWrapper -Version 1.1.2
dotnet add package MethodResultWrapper --version 1.1.2
<PackageReference Include="MethodResultWrapper" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MethodResultWrapper --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MethodResultWrapper, 1.1.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MethodResultWrapper as a Cake Addin
#addin nuget:?package=MethodResultWrapper&version=1.1.2

// Install MethodResultWrapper as a Cake Tool
#tool nuget:?package=MethodResultWrapper&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Method Result Wrapper

Provides a generic wrapper that returns whether or not a method succeeded or failed carrying the method result on success or a list of notifications in case of failure.

Interfaces

MethodResult interfaces

    public interface IMethodResult
    {
        /// <summary>
        /// At least one notification has a severity
        /// greater or equal to Error
        /// </summary>
        bool Failure { get; }

        /// <summary>
        /// No notification or all notifications severity
        /// are lower than Error
        /// </summary>
        bool Success { get; }

        SeverityEnum Severity { get; }

        /// <summary>
        /// Bulk string made of the concatenation
        /// of the notifications separated by new
        /// lines
        /// </summary>
        string ErrorMessage { get; }

        IEnumerable<IMethodResultNotification> Notifications { get; }

        /// <summary>
        /// Will throw new Exception(ErrorMessage)
        /// </summary>
        void Throw();
    }
    
    public interface IMethodResult<out T> : IMethodResult
    {
        T Data { get; }
    }

    public interface IMethodResultNotification
    {
        SeverityEnum Severity { get; }
        string Message { get; }
    }
    

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MethodResultWrapper:

Package Downloads
MsSqlLoggerService

Ms Sql implementation of MethodResultWrapper ILoggerService. Persists logs into a MsSql table.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.6 120 9/22/2021
3.0.5 103 4/28/2021
3.0.4 109 4/27/2021
3.0.3 309 6/10/2020
3.0.2 192 6/10/2020
3.0.1 203 6/10/2020
3.0.0 218 6/10/2020
2.0.1 301 3/20/2020
2.0.0 248 3/19/2020
1.1.3 207 3/20/2020
1.1.2 298 3/19/2020
1.1.0 366 3/7/2020
1.0.0 218 2/28/2020

Documentation updated