First pass at party service
This commit is contained in:
@ -109,6 +109,13 @@ namespace Aurora.Cursor
|
||||
return this;
|
||||
}
|
||||
|
||||
public Cursor<T> WithSort(string key, SortDirection direction)
|
||||
{
|
||||
this._sortDelgate = (item) => key;
|
||||
this._direction = direction;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Cursor<T> WithSize(int size)
|
||||
{
|
||||
this._pageSize = size;
|
||||
|
@ -17,8 +17,13 @@ namespace Aurora.Cursor
|
||||
|
||||
public CursorList<T> Add(T item)
|
||||
{
|
||||
string itemHashId = HashUtil.GetHash(new string[] { item.Id, item.GetHashCode().ToString() }).ToString();
|
||||
bool res = this.TryAdd(itemHashId, item);
|
||||
string id = item.Id;
|
||||
if (item.Id == null)
|
||||
{
|
||||
id = HashUtil.GetHash(new string[] { item.GetHashCode().ToString() }).ToString();
|
||||
item.Id = id;
|
||||
}
|
||||
bool res = this.TryAdd(id, item);
|
||||
|
||||
if (res == false)
|
||||
{
|
||||
|
Reference in New Issue
Block a user