55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Collections.Immutable;
|
|
using AyaNova.Biz;
|
|
using AyaNova.Models;
|
|
|
|
namespace AyaNova.Biz
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
internal interface IBizObject
|
|
{
|
|
//validate via validation attributes
|
|
//https://stackoverflow.com/questions/36330981/is-the-validationresult-class-suitable-when-validating-the-state-of-an-object
|
|
|
|
|
|
/// <summary>
|
|
/// Contains list of errors
|
|
/// </summary>
|
|
List<ValidationError> Errors { get; }
|
|
|
|
|
|
/// <summary>
|
|
/// Is true if there are errors
|
|
/// </summary>
|
|
bool HasErrors { get; }
|
|
|
|
/// <summary>
|
|
/// Is true if the field specified exists in the list
|
|
/// </summary>
|
|
bool PropertyHasErrors(string propertyName);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="errorType"></param>
|
|
/// <param name="errorMessage"></param>
|
|
/// <param name="propertyName"></param>
|
|
void AddError(ValidationErrorType errorType, string propertyName = null, string errorMessage = null);
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="validationError"></param>
|
|
void AddvalidationError(ValidationError validationError);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} |