Пример #1
0
        public static async Task <bool> TryDeleteTaskAsync <T>(this ITaskStore store) where T : ITask
        {
            var task = await store.GetTaskByTypeAsync(typeof(T));

            if (task != null)
            {
                await store.DeleteTaskAsync(task);

                return(true);
            }

            return(false);
        }
Пример #2
0
        public static Task <ITaskDescriptor> GetTaskByTypeAsync(this ITaskStore store, Type taskType)
        {
            Guard.NotNull(taskType, nameof(taskType));

            return(store.GetTaskByTypeAsync(taskType.AssemblyQualifiedNameWithoutVersion()));
        }
Пример #3
0
 public static Task <ITaskDescriptor> GetTaskByTypeAsync <T>(this ITaskStore store) where T : ITask
 {
     return(store.GetTaskByTypeAsync(typeof(T)));
 }