2019-08-14 12:20:53 +02:00
|
|
|
|
using Tapeti.Config;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.DataAnnotations
|
2017-02-12 21:43:30 +01:00
|
|
|
|
{
|
2019-08-14 12:20:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Extends ITapetiConfigBuilder to enable DataAnnotations.
|
|
|
|
|
/// </summary>
|
2017-02-12 21:43:30 +01:00
|
|
|
|
public static class ConfigExtensions
|
|
|
|
|
{
|
2019-08-14 12:20:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Enables the DataAnnotations validation middleware.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="config"></param>
|
|
|
|
|
public static ITapetiConfigBuilder WithDataAnnotations(this ITapetiConfigBuilder config)
|
2017-02-12 21:43:30 +01:00
|
|
|
|
{
|
2019-08-14 12:20:53 +02:00
|
|
|
|
config.Use(new DataAnnotationsExtension());
|
2017-02-12 21:43:30 +01:00
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|