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