The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

1

An offline code review came up with a critical piece of feedback: The constructor for Task takes an Action<T>. The async delegate therefore generates an async void method, which has 2 implications: If an unhandled exception is thrown from the async void method, it will crash the process (unlikely, since it's just calling Task.Delay(), but it's an ...


3

Not sure if it counts as an answer, but the most important missing part was the following ASP.NET Core attribute: public class AmbientContextAttribute : Attribute, IAsyncActionFilter { public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { using (new Op(context.HttpContext.Request....


1

I would personally prefer a simpler approach, using System.Reactive (Rx.NET): public abstract class ViewModel : INotifyPropertyChanged { public ViewModel(int throttlingPeriod = 250) : this(TimeSpan.FromMilliseconds(throttlingPeriod)) { } public ViewModel(TimeSpan throttlingPeriod) { Subject = new Subject<string>(); ...


Top 50 recent answers are included