using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Scheduler.Backgrounding
{
    public static class Extensions
    {
        /// <summary> unique identifier, described by IntervalID + TaskBackgrounderID </summary>
        public static string GetBGTaskID(this BGTaskInfo bgTEndEvent)
            => "id:" + bgTEndEvent.IntervalID + "-" + bgTEndEvent.TaskBackgrounderID;

        /// <summary> unique identifier, described by IntervalID + TaskBackgrounderID </summary>
        public static string GetBGTaskID(this BGTaskStartEvent bgTStartEvent)
            => "id:" + bgTStartEvent.IntervalID + "-" + bgTStartEvent.BGTaskGuid;


        /// <summary> unique identifier, described by IntervalID + TaskBackgrounderID </summary>
        public static string GetBGTaskID(this BGTaskEndEvent bgTEndEvent)
            => "id:" + bgTEndEvent.IntervalID + "-" + bgTEndEvent.BGTaskGuid;


        /// <summary> unique identifier, described by IntervalID + TaskBackgrounderID </summary>
        public static string GetBGTaskID<TResult>(this BGTaskEndEvent<TResult> bgTEndEvent)
            => "id:" + bgTEndEvent.IntervalID + "-" + bgTEndEvent.BGTaskGuid;
    }
}
