I have a screen which does a basic search on a database employee table.
User will search by First Name, Last Name, Department, IsActive, etc.
As of now I have created a SearchParameter Class :
public class EmployeeSearchParameter
{
public EmployeeSearchParameterType SearchParameterType { get; set; }
public string EmployeeSearchParameterValue { get; set; }
}
public enum EmployeeSearchParameterType
{
FirstName = 1,
LastName = 2,
EmpId= 3,
IsActive = 4
}
Will this be flexible in case if I have more options that support Custom paging like start row number, end row number, sort by, etc?
Or I can create an abstract class Search and implement?
public abstract class Search
{
public virtual Int PageSize=10;
public virtual string SortBy="DESC"
//..etc
}
public class EmployeeSearchParameter:Search
{//stuffs
}
or ISearch interface
public class EmployeeSearchParameter:ISearch
{ }
Any input for better design/simplicity and not over-architecting the problem?