You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

using System;
using System.Collections.Generic;
using System.Text;
namespace Apewer.Source
{
internal class RedisSortOptions
{
public string Key { get; set; }
public bool Descending { get; set; }
public bool Lexographically { get; set; }
public Int32 LowerLimit { get; set; }
public Int32 UpperLimit { get; set; }
public string By { get; set; }
public string StoreInKey { get; set; }
public string Get { get; set; }
public object[] ToArgs()
{
System.Collections.ArrayList args = new System.Collections.ArrayList();
if (LowerLimit != 0 || UpperLimit != 0)
{
args.Add("LIMIT");
args.Add(LowerLimit);
args.Add(UpperLimit);
}
if (Lexographically)
args.Add("ALPHA");
if (!string.IsNullOrEmpty(By))
{
args.Add("BY");
args.Add(By);
}
if (!string.IsNullOrEmpty(Get))
{
args.Add("GET");
args.Add(Get);
}
return args.ToArray();
}
}
}