GoldenCompany.Results 1.0.0

Package Description

Install-Package GoldenCompany.Results -Version 1.0.0
dotnet add package GoldenCompany.Results --version 1.0.0
<PackageReference Include="GoldenCompany.Results" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GoldenCompany.Results --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

GoldenCompany

Nuget Packages

  • Results

For use Resultsyou must import GoldenCompany.Results.

public interface IResult
{
    public bool Successed { get; }
    public bool Failed { get; }
    public string Message { get; }
}

public interface IResult<out T> : IResult
{
    public T Data { get; }
}

Samples syncronous:

public class Samples
{
    public IResult SuccessSyncronousMethod() => Result.Success();

    public IResult SuccessWithMessageSyncronousMethod(string message) => Result.Success(message);

    public IResult<T> SuccessTypedSyncronousMethod<T>() => Result<T>.Success();

    public IResult<T> SuccessTypedWithObjectSyncronousMethod<T>(T data) => Result<T>.Success(data);

    public IResult<T> SuccessTypedWithObjectAndMessageSyncronousMethod<T>(T data, string message) => Result<T>.Success(data, message);

    public IResult<T> SuccessTypedWithMessageSyncronousMethod<T>(string message) => Result<T>.Success(message);

    public IResult FailWithMessageSyncronousMethod(string message) => Result.Fail(message);
        
    public IResult<T> FailTypedWithMessageSyncronousMethod<T>(string message) => Result<T>.Fail(message);
}

Samples asyncronous:

public class Samples
{
    public Task<IResult> SuccessSyncronousMethod() => Result.SuccessAsync();

    public Task<IResult> SuccessWithMessageAsyncronousMethod(string message) => Result.SuccessAsync(message);

    public Task<IResult<T>> SuccessTypedAsyncronousMethod<T>() => Result<T>.SuccessAsync();

    public Task<IResult<T>> SuccessTypedWithObjectAsyncronousMethod<T>(T data) => Result<T>.SuccessAsync(data);
        
    public Task<IResult<T>> SuccessTypedWithObjectAndMessageAsyncronousMethod<T>(T data, string message) => Result<T>.SuccessAsync(data, message);

    public Task<IResult<T>> SuccessTypedWithMessageAsyncronousMethod<T>(string message) => Result<T>.SuccessAsync(message);
                
    public Task<IResult> FailWithMessageAsyncronousMethod(string message) => Result.FailAsync(message);
        
    public Task<IResult<T>> FailTypedWithMessageAsyncronousMethod<T>(string message) => Result<T>.FailAsync(message);
}

GoldenCompany

Nuget Packages

  • Results

For use Resultsyou must import GoldenCompany.Results.

public interface IResult
{
    public bool Successed { get; }
    public bool Failed { get; }
    public string Message { get; }
}

public interface IResult<out T> : IResult
{
    public T Data { get; }
}

Samples syncronous:

public class Samples
{
    public IResult SuccessSyncronousMethod() => Result.Success();

    public IResult SuccessWithMessageSyncronousMethod(string message) => Result.Success(message);

    public IResult<T> SuccessTypedSyncronousMethod<T>() => Result<T>.Success();

    public IResult<T> SuccessTypedWithObjectSyncronousMethod<T>(T data) => Result<T>.Success(data);

    public IResult<T> SuccessTypedWithObjectAndMessageSyncronousMethod<T>(T data, string message) => Result<T>.Success(data, message);

    public IResult<T> SuccessTypedWithMessageSyncronousMethod<T>(string message) => Result<T>.Success(message);

    public IResult FailWithMessageSyncronousMethod(string message) => Result.Fail(message);
        
    public IResult<T> FailTypedWithMessageSyncronousMethod<T>(string message) => Result<T>.Fail(message);
}

Samples asyncronous:

public class Samples
{
    public Task<IResult> SuccessSyncronousMethod() => Result.SuccessAsync();

    public Task<IResult> SuccessWithMessageAsyncronousMethod(string message) => Result.SuccessAsync(message);

    public Task<IResult<T>> SuccessTypedAsyncronousMethod<T>() => Result<T>.SuccessAsync();

    public Task<IResult<T>> SuccessTypedWithObjectAsyncronousMethod<T>(T data) => Result<T>.SuccessAsync(data);
        
    public Task<IResult<T>> SuccessTypedWithObjectAndMessageAsyncronousMethod<T>(T data, string message) => Result<T>.SuccessAsync(data, message);

    public Task<IResult<T>> SuccessTypedWithMessageAsyncronousMethod<T>(string message) => Result<T>.SuccessAsync(message);
                
    public Task<IResult> FailWithMessageAsyncronousMethod(string message) => Result.FailAsync(message);
        
    public Task<IResult<T>> FailTypedWithMessageAsyncronousMethod<T>(string message) => Result<T>.FailAsync(message);
}

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 127 4/30/2020