51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
|
|
|
|
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="errorCode"></param>
|
|
/// <param name="errorMessage"></param>
|
|
/// <param name="propertyName"></param>
|
|
void AddError(ApiErrorCode errorCode, string propertyName = null, string errorMessage = null);
|
|
|
|
// /// <summary>
|
|
// ///
|
|
// /// </summary>
|
|
// /// <param name="validationError"></param>
|
|
// void AddvalidationError(ValidationError validationError);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} |