BO4E.Extensions/BusinessObjects/Energiemenge/EnergiemengeExtension.cs
/// <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>
Get percentage of time range covered by pure Energiemenge.
Get percentage of time range covered by pure Energiemenge .
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);
            }
        }
public static decimal GetCoverage ( this BO . Energiemenge em , ITimeRange reference ) { using ( MiniProfiler . Current . Step ( nameof ( GetCoverage ) ) ) { if ( ! IsPure ( em ) ) throw new ArgumentException ( " " ) ; if ( em . Energieverbrauch . Count == 0 ) return 0.0M ; var v = em . Energieverbrauch . First ( ) ; return em . GetCoverage ( reference , v . Wertermittlungsverfahren , v . Obiskennzahl , v . Einheit ) ; } }
Get percentage of time range covered by pure Energiemenge.
Get percentage of time range covered by pure Energiemenge .
value between 0 (only coverage for 1 point in time) and 1.0 (100% coverage)
value between 0 ( only coverage for 1 point in time ) and 1 . 0 ( 100% coverage )
BO.Energiemenge
this
reference
ITimeRange
time frame reference
time frame reference
em
None