I implement a project and I have a Class for members, but each member has a method of calculating his financial reward.
public class Person : EntityValidator
{
[DisplayName("Name")]
[Required(ErrorMessage = "{0} *")]
[RegularExpression(@"^[\u0600-\u06ff\s]+$", ErrorMessage = " ")]
public string Name { get; set; }
[Required(ErrorMessage = "{0} ")]
[DataType(DataType.CreditCard)]
[RegularExpression(@"^\d{14}$",
ErrorMessage = "ا")]
public string NationalId { get; set; }
[DataType(DataType.PhoneNumber)]
[Phone]
public string Phone { get; set; }
public ICollection<Salary> Salarys { get; set; }
public virtual MemberShip MemberShip { get; set; }
So I created an interface to the calculation methods as shown in the code.
interface IArithmetiCoperation
{
decimal MonetaryAdvantage();
double DurationBetween();
}
Now first: I need the classes that inherit from this interface appear inside the combo, and when this class is identified, implement its methods and give me the results related to it. Provided that the names of the categories appear with names expressing their character and not their name inside the code.
Second: Is there a better suggestion than the interface method?