PaginationDsM.cs 786 Bytes
namespace MapsModels.DsModels
{
    public class PaginationDsM
    {
        public const string ASC = "ASC";
        public const string DESC = "DESC";
        public int from { get; set; }
        public int per_page;
        public string sort { get; set; }
        public int perPage{
            get{
                if(per_page == 0){
                    return 25;
                }
                return per_page;
            } 
            set{
                per_page = value;
            } 
        }
        public string orderType(){
            if(sort == null){
                return null;
            }
            if(sort.StartsWith("-")){
                sort = sort.Substring(1);
                return DESC;
            }
            return ASC;
        }
    }
}