BO4E.Extensions/BusinessObjects/Energiemenge/EnergiemengeExtension.cs
/// <summary>
///     Get percentage of time range covered by all Wertermittlungsverfahren/OBIS/Mengeneinheit
///     combinations, that are present in the Energiemenge-&gt;energieverbrauch array.
/// </summary>
/// <param name="em">Energiemenge</param>
/// <param name="reference">reference</param>
/// <returns></returns>
Get percentage of time range covered by all Wertermittlungsverfahren/OBIS/Mengeneinheit
combinations, that are present in the Energiemenge->energieverbrauch array.
Get percentage of time range covered by all Wertermittlungsverfahren / OBIS / Mengeneinheit combinations that are present in the Energiemenge - > energieverbrauch array .
public static decimal GetJointCoverage(this BO.Energiemenge em, TimeRange reference)
        {
            var combinations = GetWevObisMeCombinations(em);
            var jointCoverage = em.Energieverbrauch
                .Where(v => combinations.Contains(Tuple.Create(v.Wertermittlungsverfahren, v.Obiskennzahl, v.Einheit)))
                .Sum(v => GetOverlapFactor(new TimeRange((v.Startdatum ?? DateTimeOffset.MinValue).DateTime, (v.Enddatum ?? DateTimeOffset.MinValue).DateTime), reference, true));
            return jointCoverage - (combinations.Count - 1);
        }
public static decimal GetJointCoverage ( this BO . Energiemenge em , TimeRange reference ) { var combinations = GetWevObisMeCombinations ( em ) ; var jointCoverage = em . Energieverbrauch . Where ( v => combinations . Contains ( Tuple . Create ( v . Wertermittlungsverfahren , v . Obiskennzahl , v . Einheit ) ) ) . Sum ( v => GetOverlapFactor ( new TimeRange ( ( v . Startdatum ?? DateTimeOffset . MinValue ) . DateTime , ( v . Enddatum ?? DateTimeOffset . MinValue ) . DateTime ) , reference , true ) ) ; return jointCoverage - ( combinations . Count - 1 ) ; }
Get percentage of time range covered by all Wertermittlungsverfahren/OBIS/Mengeneinheit
combinations, that are present in the Energiemenge->energieverbrauch array.
Get percentage of time range covered by all Wertermittlungsverfahren / OBIS / Mengeneinheit combinations that are present in the Energiemenge - > energieverbrauch array .
None
BO.Energiemenge
this
reference
TimeRange
None
em
None