First pass at party service

This commit is contained in:
Brandon Watson
2021-03-05 19:09:42 -05:00
parent 6f73df0fb7
commit e9065db23c
6 changed files with 76 additions and 17 deletions

View File

@ -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;

View File

@ -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)
{