This commit is contained in:
51
server/biz/IBizObject.cs
Normal file
51
server/biz/IBizObject.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace Sockeye.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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user