public static ETTask <List <T> > FindAllByIndex <T>(this DBComponent db, string collectionName, string indexName, T entity) where T : ComponentWithId { ETTaskCompletionSource <List <T> > tcs = new ETTaskCompletionSource <List <T> >(); var parameters = DBHelper.GetParameterList(typeof(T), indexName, entity); DBQueryAllWithIndexTask task = ComponentFactory.Create <DBQueryAllWithIndexTask, string, List <Tuple <PropertyInfo, object> >, ETTaskCompletionSource <List <T> > > (collectionName, parameters, tcs); db.tasks[(int)((ulong)task.Id % DBComponent.taskCount)].Add(task); return(tcs.Task); }
public override void Awake(DBQueryAllWithIndexTask self, string collectionName, List <Tuple <PropertyInfo, object> > parameters, ETTaskCompletionSource <List <ComponentWithId> > tcs) { self.CollectionName = collectionName; self.Tcs = tcs; self.parameters = parameters; }