-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
For example, this code:
using System.Threading.Tasks;
using Windows.Storage;
public class ImageCache
{
public static async Task<StorageFile> Load(string url)
{
return await Load(url, null);
}
public static async Task<StorageFile> Load(string url, Crop crop)
{
return await Loader.CacheManager(url, crop);
}
Can be rewritten as:
public class ImageCache
{
public static Task<StorageFile> LoadAsync(string url)
{
return LoadAsync(url, null);
}
public static Task<StorageFile> LoadAsync(string url, Crop crop)
{
return Loader.CacheManager(url, crop);
}
- (I think) it's best to postfix async methods with 'Async'
- Don't use async Task if you are only awaiting a single task, just return the task (saves a task object that also needs garbage collecting, etc)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels