idisposable
How quickly should I close a using block?
A question came up during a code review the other day about how quickly a using block should be closed.One camp said, \'as soon as you are done with the object\'; the other, \'sometime before it goes[详细]
2023-02-20 17:57 分类:问答Is it bad design to reference Autofac in my projects just for Owned<T>?
I\'ve recently become a heavy user of Autofac\'s OwnedInstances feature.For example, I use it to provide a factory for creating a Unit of Work for my database, which means my classes which depend on t[详细]
2023-02-20 09:34 分类:问答System.ServiceModel.ServiceHost implements IDisposable but Dispose is not public
Why is that开发者_Python百科? This is not a question about the using keyword.System.ServiceModel.ServiceHost implements the IDisposable interface explicitly. This prevents that interface complicating[详细]
2023-02-17 15:18 分类:问答Unity RegisterInstance of IDisposable objects
Unity 2.0: By default RegisterInstance uses the ContainerControlledLifetimeManager. When the Unity container is disposed, it calls Dispose 开发者_如何学JAVAon the instance (if IDisposable).[详细]
2023-02-17 01:42 分类:问答Should IDisposable.Dispose() be made safe to call multiple times?
Should implementations of IDisposable make Dispose() safe to call multiple times? Or the opposite? What approach to most .NET Framework classes take?[详细]
2023-02-17 00:29 分类:问答Why have I not seen any implementations of IDisposable implementing concurrency?
When I look through 开发者_StackOverflow社区sample implementations of IDisposable, I have not found any that are threadsafe. Why is IDisposable not implemented for thread safety? (Instead callers have[详细]
2023-02-16 13:52 分类:问答How to Dispose ManualResetEvent
Hi When i use following code: myManualResetEvent.Dispose(); Compiler gives this error: \'System.Threading.WaitHandle.Dispose(bool)\' is in开发者_如何学Caccessible due to its protection level.[详细]
2023-02-16 00:17 分类:问答Keeping references to `IDisposable` when using the Reactive Extensions for .NET: always, never, or sometimes?
Up until now I have zealously kept every reference to 开发者_开发知识库the IDisposable returned from any .Subscribe(...), .Connect(...), etc, method within Rx. I\'ve done this because of my fear that[详细]
2023-02-15 05:23 分类:问答C#: IDisposable classes need 'using' clause?
If am using 开发者_开发技巧an IDisposable class, should I always use a using clause, for example:[详细]
2023-02-14 10:26 分类:问答Ninject doesn't call Dispose on objects when out of scope
I was surprised to find that at least one of my objects created by Ninject is not disposed of at the end of the request, when it has been defined to be InRequestScope[详细]
2023-02-13 18:52 分类:问答