I\'m trying to create a UniqueAttribute using the System.ComponentModel.DataAnnotations.ValidationAttribute
I want this to be generic as in I c
One problem I see already is that you can't instantiate types as parameters of attributes.
Attributes require that all arguments be compile-time constants. So the usage:
[Unique(new DataContext(),"Groups","name")]
won't compile. You may be able to omitt new DataContext() - but then I suspect your validation logic won't have information about the entity types to query.