I have a class called say
Class1
public string store { get; set; }
I want to decorate it with something like this:
Class1
[GetStoreNumberFromName]
[IsNumeric]
public string store {get; set; }
So the value may be 1234, or it may be1234 - Store name
What I need to do is check to see if the value passed is only a number. If this is not the case, I need, in the second example, to capture the first 4 chrs and change the value of the property to this.
So, if the transmitted value was 1234 - Store name, then in the end the [GetStoreNumberFromName]value storeshould be 1234, so it [IsNumeric]will be considered valid.
source
share