/// <summary>
 ///     Get percentage of time range covered by pure Energiemenge.
 /// </summary>
 /// <param name="em">pure Energiemenge</param>
 /// <param name="reference">time frame reference</param>
 /// <returns>value between 0 (only coverage for 1 point in time) and 1.0 (100% coverage)</returns>
 public static decimal GetCoverage(this BO.Energiemenge em, ITimeRange reference)
 {
     using (MiniProfiler.Current.Step(nameof(GetCoverage)))
     {
         if (!IsPure(em))
         {
             throw new ArgumentException("The Energiemenge is not pure. Cannot determine parameters.");
         }
         if (em.Energieverbrauch.Count == 0)
         {
             return(0.0M);
         }
         var v = em.Energieverbrauch.First();
         return(em.GetCoverage(reference, v.Wertermittlungsverfahren, v.Obiskennzahl, v.Einheit));
     }
 }
 /// <summary>
 ///     Get percentage of full time range of energiemenge which is covered with values.
 /// </summary>
 /// <param name="em">Energiemenge</param>
 /// <returns>value between 0 (only coverage for 1 point in time) and 1.0 (100% coverage)</returns>
 public static decimal GetCoverage(this BO.Energiemenge em)
 {
     return(em.GetCoverage(em.GetTimeRange()));
 }