Example #1
0
        public static void Delete(this SsdsContainer source, IEnumerable <string> entities, Func <string, Exception, bool> onError)
        {
            object concurrency = new object();

            Parallel.ForEach <string>(entities, delegate(string entityId, ParallelState ps)
            {
                try
                {
                    source.Delete(entityId);
                }
                catch (Exception ex)
                {
                    lock (concurrency)
                    {
                        if (!ps.IsStopped)
                        {
                            if (onError != null)
                            {
                                if (!onError(entityId, ex))
                                {
                                    ps.Stop();
                                }
                            }
                        }
                    }
                }
            });
        }
Example #2
0
        public void Delete(string id)
        {
            SsdsContainer c1 = DbContext.OpenContainer("Group");

            c1.Delete(id);
        }
Example #3
0
        public void Delete(string id)
        {
            SsdsContainer c1 = DbContext.OpenContainer("Question");

            c1.Delete(id);
        }