iasyncdisposable Questions

4

Solved

Say I have a non-sealed class that does not deal with any unmanaged resources. I need to make a single async call during its disposing stage to do some clean up. There are no other managed resource...
Eldoneldora asked 1/7, 2022 at 11:22

1

Solved

I am having a service that uses the IAsyncDisposable interface, because it holds an object that has the interface itself. public class AddressImporter : IAddressImporter { private readonly IConsum...

2

Solved

I've been familiarizing myself with some of the things (that are planned to be) added in C# 8 & .NET Core 3.0, and am unsure on the correct way to implement IAsyncDisposable (at time of writing...
Sheritasherj asked 14/4, 2019 at 16:19

2

Solved

I have the following synchronous code, which works fine: private void GenerateExportOutput() { using StreamWriter writer = new(Coordinator.OutputDirectory + @"\export.txt"); if (this...
Figure asked 27/1, 2022 at 22:41

2

Solved

I've noticed that in some case, Visual Studio recommends to do this await using var disposable = new Disposable(); // Do something Instead of this using var disposable = new Disposable(); // Do so...
Motoneuron asked 29/10, 2019 at 15:16

1

Solved

Can I do this using using var: await foreach (var response in _container.GetItemQueryStreamIterator(query)) { using var safeResponse = response; //use the safeResponse } or should I do this: ...
Spears asked 31/1, 2020 at 9:40

4

Solved

During switching to the new .NET Core 3's IAsynsDisposable, I've stumbled upon the following problem. The core of the problem: if DisposeAsync throws an exception, this exception hides any exceptio...
Aggri asked 20/11, 2019 at 12:8
1

© 2022 - 2024 — McMap. All rights reserved.