/// <summary>
 ///     Get TimeRange covered by Energiemenge
 /// </summary>
 /// <param name="menge">Energiemenge</param>
 /// <returns>
 ///     TimeRange ranging from the earliest <see cref="Verbrauch.Startdatum" /> to the latest
 ///     <see cref="Verbrauch.Enddatum" />
 /// </returns>
 /// <returns></returns>
 public static TimeRange GetTimeRange(this BO.Energiemenge menge)
 {
     using (MiniProfiler.Current.Step(nameof(GetTimeRange)))
     {
         return(new TimeRange(menge.GetMinDate().UtcDateTime, menge.GetMaxDate().UtcDateTime));
     }
 }
 /// <summary>
 ///     Test, if the Energiemenge is continuous within its own min/max range.
 ///     <see cref="IsContinuous(BO4E.BO.Energiemenge,Itenso.TimePeriod.TimeRange)" />
 /// </summary>
 /// <param name="em">Energiemenge</param>
 /// <returns>
 ///     true iff Energiemenge has defined value for every point in time t in
 ///     min(energieverbrauch.startdatum) &lt;= t &lt; max(energieverbrauch.enddatum);
 ///     false otherwise
 /// </returns>
 public static bool IsContinuous(this BO.Energiemenge em)
 {
     return(IsContinuous(em, new TimeRange(em.GetMinDate().UtcDateTime, em.GetMaxDate().UtcDateTime)));
 }
 /// <summary>
 ///     Same as
 ///     <see
 ///         cref="GetTotalConsumption(BO4E.BO.Energiemenge,BO4E.ENUM.Wertermittlungsverfahren,string,BO4E.ENUM.Mengeneinheit)" />
 ///     but without auto-detected parameters.
 ///     By default a the full length of the Energiemenge is taken into account.
 /// </summary>
 /// <param name="em">Energiemenge</param>
 /// <returns>Tuple of consumption value and unit of measurement</returns>
 public static Tuple <decimal, Mengeneinheit> GetTotalConsumption(this BO.Energiemenge em)
 {
     return(GetConsumption(em, new TimeRange(em.GetMinDate().UtcDateTime, em.GetMaxDate().UtcDateTime)));
 }