public void Delete(IEnumerable <TModel> entityList) { VoidReturnCallback callback = GetCallback <VoidReturnCallback>(); ThreadStart threadStart = new ThreadStart(delegate() { DeleteOnThread(entityList, callback); }); Thread thread = new Thread(threadStart); thread.Start(); }
public void Delete(TModel entity) { VoidReturnCallback callback = GetCallback <VoidReturnCallback>(); ThreadStart threadStart = new ThreadStart(delegate() { DeleteOnThread(entity, callback); }); Thread thread = new Thread(threadStart); thread.Start(); }
protected virtual void DeleteOnThread(IEnumerable <TModel> entityList, VoidReturnCallback callback) { ISession currentSession = Decorated.Session; Decorated.Session = Session; Decorated.Delete(entityList); callback(); Decorated.Session = currentSession; }
protected virtual void DeleteOnThread(TModel entity, VoidReturnCallback callback) { ISession currentSession = Decorated.Session; Decorated.Session = Session; Decorated.Delete(entity); callback(); Decorated.Session = currentSession; }