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(); } } } } } }); }
public void Delete(string id) { SsdsContainer c1 = DbContext.OpenContainer("Group"); c1.Delete(id); }
public void Delete(string id) { SsdsContainer c1 = DbContext.OpenContainer("Question"); c1.Delete(id); }