Example #1
0
        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();
        }
Example #2
0
        public void Delete(TModel entity)
        {
            VoidReturnCallback callback = GetCallback <VoidReturnCallback>();
            ThreadStart threadStart = new ThreadStart(delegate() { DeleteOnThread(entity, callback); });
            Thread thread = new Thread(threadStart);

            thread.Start();
        }
Example #3
0
        protected virtual void DeleteOnThread(IEnumerable <TModel> entityList, VoidReturnCallback callback)
        {
            ISession currentSession = Decorated.Session;

            Decorated.Session = Session;
            Decorated.Delete(entityList);
            callback();
            Decorated.Session = currentSession;
        }
Example #4
0
        protected virtual void DeleteOnThread(TModel entity, VoidReturnCallback callback)
        {
            ISession currentSession = Decorated.Session;

            Decorated.Session = Session;
            Decorated.Delete(entity);
            callback();
            Decorated.Session = currentSession;
        }