WEB Core suggestion re: async

It seems like the [async] tag needs to be put in front of individual methods in a class. As Holger mentions, putting it on event handlers makes it subject to quirks of the IDE's tendency to reorganize things -- it does that with comments there as well, but they're harmless.

How about allowing it at the 'class' level? That way it will apply to ALL of the methods in a given class, and it will save some angst when you forget to add it to a given method where you have await(...) being used. (I've wasted quite a bit of time with this issue by forgetting this or putting it on the wrong method a few times.)

Maybe it can already be used that way, but I imagine Holger would have mentioned that in his recent video if that's the case.

I've got units that are mainly used for interfacing and they need it on a LOT of the methods in the unit. I'd rather be able to just put it at the top like with the [Authorize] attribute that is used in the Interface part of an XData service. I can't imagine it adds that much overhead.

At this moment, it cannot be set at class level.
We'll discuss this in the team if it would not cause unwanted side-effects.

1 Like