BO4E.Extensions/BusinessObjects/Energiemenge/EnergiemengeExtension.cs
/// <summary>
///     Get Average (<see cref="GetAverage(BO.Energiemenge, TimeRange, Wertermittlungsverfahren?, string, Mengeneinheit)" />
///     )
///     for a pure Energiemenge with automatically found parameters.
/// </summary>
/// <seealso cref="IsPure"/>
/// <param name="em">Energiemenge</param>
/// <returns>Tuple of average value and unit of measurement</returns>
Get Average (
)
for a pure Energiemenge with automatically found parameters.
Get Average ( ) for a pure Energiemenge with automatically found parameters .
public static Tuple<decimal?, Mengeneinheit> GetAverage(this BO.Energiemenge em)
        {
            if (!IsPure(em)) throw new ArgumentException("Energiemenge is not pure.");
            if (em.Energieverbrauch.Count == 0) return Tuple.Create<decimal?, Mengeneinheit>(null, Mengeneinheit.KW);
            var v = em.Energieverbrauch.First();
            return Tuple.Create(em.GetAverage(v.Wertermittlungsverfahren, v.Obiskennzahl, v.Einheit), v.Einheit);
        }
public static Tuple < decimal ? , Mengeneinheit > GetAverage ( this BO . Energiemenge em ) { if ( ! IsPure ( em ) ) throw new ArgumentException ( " " ) ; if ( em . Energieverbrauch . Count == 0 ) return Tuple . Create < decimal ? , Mengeneinheit > ( null , Mengeneinheit . KW ) ; var v = em . Energieverbrauch . First ( ) ; return Tuple . Create ( em . GetAverage ( v . Wertermittlungsverfahren , v . Obiskennzahl , v . Einheit ) , v . Einheit ) ; }
Get Average (
)
for a pure Energiemenge with automatically found parameters.
Get Average ( ) for a pure Energiemenge with automatically found parameters .
Tuple of average value and unit of measurement
Tuple of average value and unit of measurement
BO.Energiemenge
this
em
None
seealso
None