35 lines
981 B
C#
35 lines
981 B
C#
8 years ago
|
using System.ComponentModel.DataAnnotations;
|
||
|
|
||
8 years ago
|
namespace Yavsc.Models.Process
|
||
8 years ago
|
{
|
||
|
/// <summary>
|
||
|
/// An abstract, identified rule
|
||
|
/// </summary>
|
||
6 years ago
|
public abstract class Rule<TResult,TInput>
|
||
8 years ago
|
{
|
||
|
[Key]
|
||
|
public string Id { get; set; }
|
||
|
|
||
|
/// <summary>
|
||
6 years ago
|
/// Left part for this class of rule, a conjonction.
|
||
8 years ago
|
/// All of these requisitions must be true
|
||
|
/// in order to begin any related process.
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
public Conjonction Left { get; set; }
|
||
|
/// <summary>
|
||
|
/// Right part of this rule, a disjonction.
|
||
|
/// That is, only one of these post requisitions
|
||
|
/// has to be true in order for this rule
|
||
|
/// to expose a success.
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
public Disjonction Right { get; set; }
|
||
|
|
||
|
public string Description { get; set; }
|
||
|
|
||
6 years ago
|
public abstract TResult Execute(TInput inputData);
|
||
8 years ago
|
|
||
|
}
|
||
|
}
|