From bd6ce619903e9fd04ab0b89680eae0fafa6c5a70 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 6 Feb 2021 20:31:41 +0100 Subject: [PATCH] chore: edit filetype attr usage * allow on {field, property,parameter} * allow attr to be used only once per item --- Models/Validation/FileTypeAttr.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Models/Validation/FileTypeAttr.cs b/Models/Validation/FileTypeAttr.cs index a376d4a..3998c05 100644 --- a/Models/Validation/FileTypeAttr.cs +++ b/Models/Validation/FileTypeAttr.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace pwt_0x01_ng.Models.Validation { + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false)] public class FileTypeAttr : ValidationAttribute, IClientModelValidator { private readonly string type;