internal static void AddService(object service) { var serviceStack = DataServiceScopeStack?.Peek(); Verify.IsNotNull(serviceStack, "The data service stack was not pushed before use"); serviceStack.Add(service); }
internal static void PopDataServiceScope() { Verify.That(DataServiceScopeStack.Count > 0, nameof(DataServiceScopeStack) + " underflow"); DataServiceScopeStack.Pop(); }
internal static void PushDataServiceScope() { DataServiceScopeStack.Push(new List <object>()); }
internal static void PopDataServiceScope() { Verify.That(DataServiceScopeStack.Count > 0, nameof(DataServiceScopeStack) + " underflow"); DataServiceScopeStack.Pop().ForEach(f => (f as IDisposable)?.Dispose()); }