How can I create a generaic ValidationAttribute in C#?
- by sabbour
I'm trying to create a UniqueAttribute using the System.ComponentModel.DataAnnotations.ValidationAttribute
I want this to be generic as in I could pass the Linq DataContext, the table name, the field and validate if the incoming value is unique or not.
Here is a non-compilable code fragment that I'm stuck at right now:
using System;
using…