21 lines
914 B
C#
Raw Permalink Normal View History

2025-04-21 14:10:27 +08:00

namespace MyCode.Project.Infrastructure
{
/// <summary>
/// Represents that the implemented classes are specification parsers that
/// parses the given specification to a domain specific criteria object, such
/// as the <c>ICriteria</c> instance in NHibernate.
/// </summary>
/// <typeparam name="TCriteria">The type of the domain specific criteria.</typeparam>
public interface ISpecificationParser<TCriteria>
{
/// <summary>
/// Parses the given specification to a domain specific criteria object.
/// </summary>
/// <typeparam name="T">The type of the object to which the specification is applied.</typeparam>
/// <param name="specification">The specified specification instance.</param>
/// <returns>The instance of the domain specific criteria.</returns>
TCriteria Parse<T>(ISpecification<T> specification);
}
}