41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using CommonTools.Enums;
|
|
using CommonTools.ViewModels;
|
|
using System.Collections.Generic;
|
|
|
|
namespace CommonTools.OperationResultModels
|
|
{
|
|
/// <summary>
|
|
/// Результат любой операции
|
|
/// </summary>
|
|
public class OperationResultModel
|
|
{
|
|
/// <summary>
|
|
/// Успешность операции (количество ошибок = 0)
|
|
/// </summary>
|
|
public bool IsSucceeded => Errors.Count == 0;
|
|
|
|
/// <summary>
|
|
/// Статус операции
|
|
/// </summary>
|
|
public ResultServiceStatusCode StatusCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// Спсиок ошибок
|
|
/// </summary>
|
|
public List<(string Title, string Message)> Errors { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Объект, получаемый по результатам операции
|
|
/// </summary>
|
|
public object Result { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Конструктор по умолчанию
|
|
/// </summary>
|
|
public OperationResultModel()
|
|
{
|
|
Errors = new List<(string Title, string Message)>();
|
|
StatusCode = ResultServiceStatusCode.Success;
|
|
}
|
|
}
|
|
} |