OperationResultCore 4.1.0

Suggested Alternatives

Calabonga.Results

Additional Details

The new package is more flexible and has enormous performance compared to OperationResultCore

dotnet add package OperationResultCore --version 4.1.0
NuGet\Install-Package OperationResultCore -Version 4.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OperationResultCore" Version="4.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OperationResultCore --version 4.1.0
#r "nuget: OperationResultCore, 4.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OperationResultCore as a Cake Addin
#addin nuget:?package=OperationResultCore&version=4.1.0

// Install OperationResultCore as a Cake Tool
#tool nuget:?package=OperationResultCore&version=4.1.0

OperationResult

OperationResult is an implementation of RFC7807. In other words, it's simple wrapper for result operation for any returned data from backend, where you can add additional information about problem or other things.

"Частичная реализация" стандарта RFC7807, который определяет в документе следующее:

This document defines a "problem detail" as a way to carry machine- readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs.

Суть в том, что если у вас есть API и в нем есть методы отдающие данные, например Product, то в результате успешного результата вы должны отдать сам объект Product. А вот если по какой-то причине вы не можете отдать конкретный объект (или объекты), тогда вы должные указать по какой причине вы не можете это сделать. Другими словами "детализировать проблему" (problem detail). А как это сделать как раз и описывает стандарт RFC7807.

Почему "Частичная реализация"? Потому что nuget-пакет и, соответственно, потребность в нем появилась задолго до появления стандарта. Постепенно, пакет трансформируется под стандарт, но это может занять некоторое время. Если у вас нет времени ждать, пишите свою реализацию или воспользуйтесь стандартами на платформе ASP.NET Core.

Версии

v4.1.0

  • Добавлена конструкция создания экземпляра сразу с Exception, но при этому с Result = null. Для этого добавлен метод WithException().
  • Добавлено несколько unit-тестов для WithException().

v4.0.2

  • Добавлена структура Empty для того, чтобы не требовался класс для создания объекта OperationResult. Тепер можно использовать Empty для создания OperationResult<T>, если не требуется никакой конкретный класс, но при этом остальные возможности востребованы.
  • Исправлены некоторые недочеты при публикации nuget-пакета.
  • Добавлено несколько unit-тестов.

Репозиторий

GitHub

Пакеты Nuget

Nuget OperationResult

Nuget OperationResultCore

Дополнительно

Статья в блоге 1

Статья в блоге 2

Видео YouTube

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on OperationResultCore:

Package Downloads
Calabonga.UnitOfWork.Controllers

Unit of Work implementation over ASP.NET Core Controllers

Calabonga.AspNetCore.Controllers

Unit of Work implementation for EntityFramework Core. Package based over the mediatr pattern (mediatr package used). For more information please see Calabonga.UnitOfWork package. Mediator pattern impementation.

Calabonga.SpecRepositoryCore

Repository and Specification patterns implementations for EntityFrameworkCore with pagination and other sugar

Calabonga.EntityFrameworkCore

Simply Data Accesss Layer for EntityFramework with some helpfull features.

Calabonga.EntityFrameworkCore.UnitOfWork.Framework

UnitOfWork for Microservices. All microservices in the system should and can use Unit of Work pattern. This package implements this pattern.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on OperationResultCore:

Repository Stars
Calabonga/Microservice-Template
Templates for microservice architecture. Nimble Microservice Framework contains two modules. The first with OpenIddict and the second without OpenIddict. Templates are built on ASP.NET Core platform with different versions Core3.1, NET6, NET7 and NET8. You can create a new project extremely fast: in Visual Studio, Rider, dotnet CLI.
Version Downloads Last updated
4.1.0 686 9/21/2023
4.1.0-beta2 172 7/20/2023
4.1.0-beta1 110 7/12/2023
4.0.3 303 6/20/2023
4.0.2 419 6/11/2023
4.0.2-beta2 133 12/31/2022
4.0.2-beta1 123 12/31/2022
4.0.1 1,339 12/31/2022
4.0.0 732 8/22/2022
4.0.0-beta2 162 4/3/2022
4.0.0-beta1 145 4/2/2022
3.0.1 2,501 12/3/2021
3.0.0 3,883 1/26/2021
2.1.3 1,813 9/24/2020
2.1.2 2,873 4/6/2020
2.1.1 1,283 3/27/2020
2.1.0 541 3/24/2020
2.0.14 2,871 11/27/2019
2.0.13 533 11/13/2019
2.0.12 523 11/8/2019
2.0.11 555 10/31/2019
2.0.10 531 10/30/2019
2.0.9 517 10/30/2019
2.0.8 530 10/29/2019
2.0.7 1,327 10/22/2019
2.0.1 1,062 10/4/2019
2.0.0 512 10/2/2019
1.1.0 1,754 7/18/2019
1.0.1 2,265 11/20/2018
1.0.0 8,011 11/17/2017
1.0.0-beta1 969 11/16/2017

OperationResult.WithException added