public SearchOptions getOptions(SearchOptions defaults) { SearchOptions res = defaults; if (search != null && search.Length > 0) { res = res.Search(search[0].field, search[0].value); } if (sort != null && sort.Length > 0) { res = res.Sort(sort[0].field, sort[0].direction); } return res.Limit(this.offset, this.limit); }